Display news depending what page is being viewed

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
thebruce
New Member
New Member
Posts: 2
Joined: Wed Feb 27, 2008 8:28 pm

Display news depending what page is being viewed

Post by thebruce »

Hi,

I guess this is a documentation question also.

I'm looking for a list of all of the functions/methods/variables etc that each object has. i.e. if $content has a ->title variable accessable etc. Where can I find this? I couldn't find it in the API  ???

Basically what I'm trying to do in a template is:

Code: Select all

{if $entry->title == "Home"}
      {* Start News *}
      <div id="news">
         <h2>News</h2>
          {news number='2' detailpage='news'}
      </div>
      {* End News *}
{/if}
but I don't know if the title object supports that.

Any hints?
cyberman

Re: Display news depending what page is being viewed

Post by cyberman »

You can use the tag {get_template_vars} to get a list for all Smarty variables available on a page.

If variable is an array you can use php function print_r as modifier to show the elements of the array (e.g. {$entry|print_r}).
thebruce
New Member
New Member
Posts: 2
Joined: Wed Feb 27, 2008 8:28 pm

Re: Display news depending what page is being viewed

Post by thebruce »

Thanks, that got me on my way.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Display news depending what page is being viewed

Post by Dr.CSS »

Or you could add a second content block then in the page add the news tag and give CSS to news not div of content block...
Post Reply

Return to “Layout and Design (CSS & HTML)”