News title on the title of the page for cmsms 1.5.2+

Do something cool with CMS? Show us ...
This board is for 'Answers', and the discussion of answers... Not for questions.
WebGirl

Re: News title on the title of the page for cmsms 1.5.2+

Post by WebGirl »

Hi viebig,

this looks great - I've just installed News module - and trying to work out how to get Pretty URLs - still trying :(

Once I've done that, I'll be able to come back here and try to work this out for my client site as well - thanks!
User avatar
imeos
New Member
New Member
Posts: 4
Joined: Thu Jul 30, 2009 5:20 am
Location: Germany

Re: News title on the title of the page for cmsms 1.5.2+

Post by imeos »

Very nice and helpful post.

Cheers  :)
WebGirl

Re: News title on the title of the page for cmsms 1.5.2+

Post by WebGirl »

viebig wrote:
Please, comment it, feedback is always appreciated.

And a special cheer to people that read this whole post! (write cheers on the end of your reply so I know that you´re read all that crap)

Regards

Viebig
VIEBIG!!

Thank you thank you! I kept putting this off because it looked too difficult, but it only took a minute or two and I AM SO HAPPY with the results!

I used it on CMSMS 1.6 (yes, I know I have to upgrade :))

Cheers & Hooray to Viebig!
Last edited by WebGirl on Wed Sep 02, 2009 7:19 am, edited 1 time in total.
DCX
Forum Members
Forum Members
Posts: 31
Joined: Fri Jan 09, 2009 7:35 am

Re: News title on the title of the page for cmsms 1.5.2+

Post by DCX »

Thanks for all this info. I got the news title working AOK but have one small tweak that is racking my brain.

The news title code now displays >> Site Name - Page Title
I am trying to switch that to >> Page Title - Site Name

Sounds simple enough but my hack attempts result in errors so far. Existing code looks like this, as described earlier in this post.

Code: Select all

<title>{if isset($pagetitle)}{$pagetitle} - {sitename}{else}{title} - {sitename}{/if}</title>
Can someone help me flip the site and page titles please?

Thank you
Last edited by DCX on Sat Oct 24, 2009 8:45 am, edited 1 time in total.
Russ
Power Poster
Power Poster
Posts: 813
Joined: Fri Nov 25, 2005 5:02 pm
Location: North West England

Re: News title on the title of the page for cmsms 1.5.2+

Post by Russ »

Hi DCX, assuming your are capturing content and assigning variables correctly? (Check out the Smarty manual for capture and assign)
Your code will work, I use something similar.
DCX
Forum Members
Forum Members
Posts: 31
Joined: Fri Jan 09, 2009 7:35 am

Re: News title on the title of the page for cmsms 1.5.2+

Post by DCX »

My code does work. I am just trying to display the Page Title first instead of the Site Name first. Trying to flip them around. I keep getting smarty errors. Thanks.
Jos
Support Guru
Support Guru
Posts: 4017
Joined: Wed Sep 05, 2007 8:03 pm
Location: The Netherlands

Re: News title on the title of the page for cmsms 1.5.2+

Post by Jos »

maybe the smarty errors come from something else, your code looks fine. What is the error-message exactly?
DCX
Forum Members
Forum Members
Posts: 31
Joined: Fri Jan 09, 2009 7:35 am

Re: News title on the title of the page for cmsms 1.5.2+

Post by DCX »

I think I am saying this in a confusing way.

I am using the above and it shows "SiteName - PageTitle" with no trouble. Like this.

Code: Select all

<title>{if isset($pagetitle)}{$pagetitle} - {sitename}{else}{title} - {sitename}{/if}</title>
I am trying to change it to show "PageTitle - SiteName" instead. So I tried this. It does not work.

Code: Select all

<title>{if isset($sitename)}{$sitename} - {pagetitle}{else}{title} - {pagetitle}{/if}</title>
I tried many variations aside from that one. None of them work so far.
Jos
Support Guru
Support Guru
Posts: 4017
Joined: Wed Sep 05, 2007 8:03 pm
Location: The Netherlands

Re: News title on the title of the page for cmsms 1.5.2+

Post by Jos »

Code: Select all

<title>{if isset($pagetitle)}{$pagetitle} - {sitename}{else}{title} - {sitename}{/if}</title>
The check on the pagetitle has to stay in  ;)

edit: reading back your former posts, there is some mayor inconsistancy in it too  ::)  :)

edit2: And wath for the $ signs for $pagetitle, I edited the code you most likely want it.
Last edited by Jos on Sat Oct 24, 2009 9:05 pm, edited 1 time in total.
DCX
Forum Members
Forum Members
Posts: 31
Joined: Fri Jan 09, 2009 7:35 am

Re: News title on the title of the page for cmsms 1.5.2+

Post by DCX »

Thank you Jos! It works like a charm.
Jos
Support Guru
Support Guru
Posts: 4017
Joined: Wed Sep 05, 2007 8:03 pm
Location: The Netherlands

Re: News title on the title of the page for cmsms 1.5.2+

Post by Jos »

And it's exactly the same code you placed yourself in your first post here  ;D

You can even write it a little shorter

Code: Select all

<title>{if isset($pagetitle)}{$pagetitle}{else}{title}{/if} - {sitename}</title>
The Wizl
New Member
New Member
Posts: 9
Joined: Mon Jun 22, 2009 2:55 pm

Re: News title on the title of the page for cmsms 1.5.2+

Post by The Wizl »

Hi

Just want to say thanks for this wonderful solution. This CMS and it´s "users" and developers rules!!

/Wizl
quantumchris
New Member
New Member
Posts: 2
Joined: Thu Dec 17, 2009 10:39 am

Re: News title on the title of the page for cmsms 1.5.2+

Post by quantumchris »

I wanted to add news titles to the tag and I just got it correctly working thanks to this thread.

Thanks guys!
viebig

Re: News title on the title of the page for cmsms 1.5.2+

Post by viebig »

Great! Thank you for reading. Please suggest more "articles", tutorials and howtos, when I have time, I´ll publish them!

Regards

G
Wishbone
Power Poster
Power Poster
Posts: 1369
Joined: Tue Dec 23, 2008 8:39 pm

Re: News title on the title of the page for cmsms 1.5.2+

Post by Wishbone »

nevermind... I thought I was onto something special... but after I re-read the first post, it ended up that I basically did the same thing and I wasn't really as original as I thought. :)
Last edited by Wishbone on Tue Dec 29, 2009 3:30 am, edited 1 time in total.
Post Reply

Return to “Tips and Tricks”