Hi,
I'm running the latest CMSmadesimple and love it. I have a question about the title that shows in the tag of my site. I want to use the Description (title attribute): that is found under options. So I've made the change to my template. But if I don't enter anything in the Description (title attribute) area then I want it to revert and use the Title: found under the 'Main' tab in the admin. What code would I put in my template to do this. If Description (title attribute): is there show it, if not show Title:. Thanks!
Description (title attribute)
-
- Forum Members
- Posts: 68
- Joined: Wed Aug 15, 2007 8:11 pm
Re: Description (title attribute)
Smarty is your friend.
Use something like:
hope this helps.
/Z
Use something like:
Code: Select all
{if $variable neq ''}
{$variable}
{else}
{title}
{/if}
/Z
Re: Description (title attribute)
Sorry for being thick but should it be :
inside the tags on the template?
It causes an error for me
Thanks
Mark
Code: Select all
{if description neq ''}
{description}
{else}
{title}
{/if}
It causes an error for me
Thanks
Mark
-
- Forum Members
- Posts: 68
- Joined: Wed Aug 15, 2007 8:11 pm
Re: Description (title attribute)
I ended up editing the plugins/function.description.php to do what I needed. It checks to see if there's a description and uses that otherwise it uses the title. Just put {description} in your template where you want to use it. Copy of the file is attached.
- Attachments
-
[The extension txt has been deactivated and can no longer be displayed.]
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: Description (title attribute)
Reading the help for the tags, and the smarty manual helps:
Code: Select all
{capture assign='tmp'}{description}{/capture}
{if empty($description)}
{title assign='tmp'}
{/if}
<title>{$tmp}</title>
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.