Hello All!
This is my first post of what I believe will be many on the Drupal forums...nice to meet you all.
I am currently working on my website, a blog/showcase of my work...I am a film/animation director and compositor. I have some background in web development/design and so have decided to take some time off to promote myself and just create a central point for my work. I do have very limited Drupal knowledge however...
So here we go with the Drupal side of things...
At the moment my current problem is being able to target individual 'Stories'...or to separate out the $content. For example at the moment I have a div which I would like to be wrapped around each 'Story' individually on the main page. But the only way I can think to do it is as follows...
<div>
<div>
<?php echo $content; ?>
</div>
</div>
Which obviously doesn't work as all it does is put all the content inside one div...how would I go about breaking up the $content...and then looping or I guess echoing the stories...
I apologise if this makes no sense whatsoever, but any ideas, further reading or solutions would be awesome. I have read around a lot, but just cant seem to narrow down my searches to find a solution to this...
Thank you for your time,
Ross
Comments
I would guess you are looking
I would guess you are looking at page.tpl.php where $content can mean many things but from what you say you want to look at node.tpl.php which formats a single 'node' or piece of content be it a story, page or other content type.
Hi nevets, thanks for you
Hi nevets, thanks for you reply....
You are right in thinking that I am looking at the page.tpl.php ... I have tried to look at the node.tpl.php from the page.tpl.php by using...
But this does not work either. Do you have any links or ideas as to how to do what I am trying to do?
Thanks
Ross
story.tpl.php
You can copy the node.tpl.php file of your theme and rename it to story.tpl.php. This file will only render story nodes.
It looks to me like you are trying to change the way your stories are displayed in teaser lists, is that right?
You can tell what is output only when displaying teasers from what is displayed when the node is in full page mode from the control structure around either the $page or $teaser variables.
$page is TRUE (or != 0) when the node is displayed by itself.
$teaser is TRUE (or == 0) when the node is displayed as part of a list.
To simplify extremely, you can look at it this way:
$content in your node.tpl.php (or story.tpl.php) refers to one post.
$content in page.tpl.php refers, in the case of a teaser list, to an agglomeration of all the $content variables as they were individually themed in their various tpl.php files.
The information I have been able to make the most use of regarding the theme system is in the Pro Drupal Development book by VanDyk. You can look up the chapter on the theme system on Google Books.
story.tpl.php should be
story.tpl.php should be node-story.tpl.php
Still having problem...
Hello again all,
I have come back to trying to build a Drupal portfolio for myself (was insanely busy since my last post) and I am still running into the same problems as before.
I cannot seem to get the $content to be anything but a massive chunk of text instead of individual posts....to be honest I am not really understanding the whole story/page/node idea....I dont think.
My main goal is to create a custom theme...the main page of my website will have all of my content shown with each post in its own individual box (div) in a sort of grid format. There will be a checkbox list in the top left hand corner of the page which will allow the user to filter content. So for example if they are not interested in my commercial work and only wish to view my directorial work, they can uncheck the directorial box and the page will reload minus any content tagged as directorial. Each post on the main page will begin with a the Post Header, followed by a thumbnail of the content or a relevant image, then the actual body of text (clipped at say 300 characters), a list of keywords, then date/time of post and person who posted it. The way the content is displayed on the main page will be uniform....regardless of the content type.
However when a user clicks on a post to read more...each content type will have its own list of fields, for example my commercial work will have a video embedded, whereas a blog entry may only contain text...(perhaps i would create only one type of content? and not make all the fields compulsory?)...again this content will be displayed in a grid format...one box for say a video, the next for a description and then user comments etc....
Now I have gotten the website to work with dummy content actually typed into the html not reading for a database...so that is ok. My problem is being able to actually target the content i want, and how to store the content i want...
I have used a CCK and added my own fields for the different content types...but I have no idea how to get to display on the pages....
I have no idea if this is making any sense...but if anyone has any suggestions about what to read or where to look, or perhaps has an idea of what i am trying to do and can tell me how to do it, then that would be great....
Thanks
Ross