Hi,
In order to just show content on certain pages, I have for example"
{if $page_alias eq "home"}
{$second_content}
{/if}
in a template.
I use this as not all pages need the second content block, but the problem I have is content editors can see this second content block on every page that uses the template.
Is there a better way to do this?
I could just add a new template for each section, but wonder about page loading speed? Is there much of an effect with extras templates?
Thanks for any help, it is much appreciated.
Cheers,
Paul
Same template but only showing content blocks on some pages?
Re: Same template but only showing content blocks on some pa
I very much doubt you would be able to measure page loading speed difference.
But regardless of that, how about using global content blocks and show (or not) with similar if then functionality?
http://docs.cmsmadesimple.org/content/g ... ent-blocks
But regardless of that, how about using global content blocks and show (or not) with similar if then functionality?
http://docs.cmsmadesimple.org/content/g ... ent-blocks
Re: Same template but only showing content blocks on some pa
Thanks Paul, but on this particular site, I think from past experience the client would just become confused with the GCB's - it seems easier to have them access the page via the admin and edit there.
May be easier just to create new templates, its a simple enough task.
Thanks for the reply.
May be easier just to create new templates, its a simple enough task.
Thanks for the reply.
Re: Same template but only showing content blocks on some pa
you may want to look at template inheritance if the only difference between templates is an extra content block.
Re: Same template but only showing content blocks on some pa
Thanks again, that looks template inheritance looks like an ideal solution.
Again, possibly an odd question but do you think there would be a page loading speed difference using template inheritance over 2 different templates?
Cheers,
Paul
Again, possibly an odd question but do you think there would be a page loading speed difference using template inheritance over 2 different templates?
Cheers,
Paul
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: Same template but only showing content blocks on some pa
Smarty templates are compiled into PHP code only when the system thinks that the templates have been modified, or no compiled template exists. Therefore if your database, and file system times are in sync the template will only be compiled IF it has changed (or the compiled file does not exist). Therefore there should be no significant performance difference.pwg wrote:Again, possibly an odd question but do you think there would be a page loading speed difference using template inheritance over 2 different templates?
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: Same template but only showing content blocks on some pa
Great, thanks a lot calguy.
Cheers,
Cheers,
Re: Same template but only showing content blocks on some pa
You could give it a tab= parameter, that will put it at the top set of tabs, Main, Options, Preview, out of line of site out of mind
...
