drupal-6


How do you separate the template of a blog block in Drupal?


In Drupal, I created a block using views. This block contains the latest blog entries. I've placed this on a specific page to display it as an archive. Now, as for the blog itself (for example when one of them is clicked), A blog template for it depends on node-blog.tpl.php. My problem is, when I style node-blog.tpl.php, the block I created for the archives (as it displays on the page) gets affected.
For example if I add TEST on node-blog.tpl.php, I will also get that on the block for every entry. I think it's because it is associated to a blog entry? What I want is to have node-blog styled "alone" when blog entries are viewed individually and not get the other entries on the blocks on the archive page be affected. How should I do this?
In your view you are probably using the "node" row style. This means that each blog in your block view is displayed as a full node and will be affected by node-blog.tpl.php
The easiest way to fix this is to change row style to "fields" and select the individual fields to display in the view. Then you can individually theme each field using the view's custom .tpl.php files (you can click on Theme: Information in the view to see scanned tpl.php files).
Another way to fix this would be to select "teaser" build mode in the row style settings. Then in node-blog.tpl.php do something like the following:
if ($teaser) {
//Display stuff for the block
}
else {
//Display stuff for the full page
}

Related Links

How should I control drupal cache when switching themes in my module hook_init?
Drupal website breaking in IE 8, 7 - theme not getting applied
Drupal 6 db_query files table
CCK field value count never less than 1 or NULL
hook_menu Title
Drupal autocomplete fails to pull out data as a subdomain
show administration theme when editing page in drupal
Get root taxonomy name in drupal view
Drupal content title doesn't show
Content administer page
Allowing Users to create custom groups of Countries
Drupal: Horizontal Menu
Drupal6 - Export bulk node
Drupal 6 <front>/node lists all nodes (unwanted)
Drupal 6 Syntax Highlighting
Theming node body in Drupal 6

Categories

HOME
testing
listview
cookies
urbancode
react-virtualized
read-eval-print-loop
rsyslog
routes
paw-app
rubygems
enterprise-library-5
cross-validation
webrequest
gnupg
google-cloud-ml
gz
circuit
try-catch
vaadin7
django-admin
highlight.js
google-pagespeed
zapier
object-detection
scriptcs
jquery-ajaxq
css-animations
jndi
cas
poltergeist
compatibility
jaxb2
libssl
madlib
nat
contact-form
stringtemplate
repo
environment-modules
occlusion
fedex
btrace
qsslsocket
pnotify
nstextview
capacity
mako
linode
cubes
angular-strap
spring-android
rotativa
trash
transmitfile
holder.js
0xdbe
ios9.1
modalpopup
pick
java.util.concurrent
xojo
phpthumb
bundles
flexmojos
uv-mapping
flashvars
delphi-6
tinn-r
quickdialog
venn-diagram
pysimplesoap
labwindows
viewswitcher
regsvr32
pendrive
heartbeat
subgurim-maps
locate
google-friend-connect
forums
mirah
pascal-fc
signal-handling

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App