• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Passing a parameter in a cms_selflink [solved]
PostPosted: Tue Aug 03, 2010 11:21 am 
Offline
Forum Members
Forum Members

Joined: Fri Oct 03, 2008 4:52 am
Posts: 31
I'm sure this is very simple but I can't work it out.

Let's say I have a page where I have buttons that relate to to different news categories.

News about dogs

News about cats

News about sheep


I have a news page "mynews"

with the tag {news category=x}

So when the user clicks on "News about dogs" I have a cms_selflink to mynews passing the parameter "Dogs" as x.

I hope this makes sense.

Thanks


Last edited by triggersmith on Wed Aug 04, 2010 12:20 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Passing a parameter in a cms_selflink
PostPosted: Tue Aug 03, 2010 12:51 pm 
Why not creating a page for each category and use cms_selflink to link to that page?
In this page you can use the page alias as news category:

{news category=$content_alias}

You could also use the browsecat param to list news catgories.
Each category will be a link that displays news articels of  the selected category.

Another solution could be the param "urlparam" of the cms_selflink:

{cms_selflink page="mynews" urlparam="category=..."}

This will link to your news page with an additional variable "category".
You now can call your news like this:

{news category=$smarty.get.category}


Top
  
 
 Post subject: Re: Passing a parameter in a cms_selflink
PostPosted: Tue Aug 03, 2010 10:15 pm 
Offline
Forum Members
Forum Members

Joined: Fri Oct 03, 2008 4:52 am
Posts: 31
Thanks for your reply.

I realise I can have a page for each category but I am expecting to have 50, 100 or even more news categories.  It seems a bit silly to have that many pages with the only difference being the category.  There has to be a more elegant way of doing it.

I don't want to use the browse category option because I want the main page to be a business logo with a direct link to their news (category).

I will try you other suggestion and report back.

As an aside there seems to be soo many features of CMS MS (which I love BTW) that have very little info on how to use them, examples etc.

Like for instance the additional page parameters which I though may have been a solution here.

Thanks again, I'll get back.
Paul


Top
 Profile  
 
 Post subject: Re: Passing a parameter in a cms_selflink
PostPosted: Tue Aug 03, 2010 11:45 pm 
Offline
Forum Members
Forum Members

Joined: Fri Oct 03, 2008 4:52 am
Posts: 31
OK I think I have this nearly working but I think there is a syntax problem or something.

This is my tag

{cms_selflink page="partner-news-detail"  urlparam="category=Horses NZ" text="news"}

When I click on the news link in my browser it can't find the page.  Here is the url I get:

http://mywebsite.co.nz/index.php?page=p ... orses%20NZ

It's like there is a separator missing between the page name and the param.

What have I done wrong here.

Thanks


Top
 Profile  
 
 Post subject: Re: Passing a parameter in a cms_selflink
PostPosted: Tue Aug 03, 2010 11:46 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Tue Oct 19, 2004 6:44 pm
Posts: 7056
Location: Fernie British Columbia, Canada
urlparam='?foo=bar'

_________________
Follow me on twitter
--
if you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
----------------
Don't make me angry..... you won't like me when I'm angry....


Top
 Profile  
 
 Post subject: Re: Passing a parameter in a cms_selflink
PostPosted: Wed Aug 04, 2010 12:03 am 
Offline
Forum Members
Forum Members

Joined: Fri Oct 03, 2008 4:52 am
Posts: 31
calguy1000 wrote:
urlparam='?foo=bar'


I worked it out actually

urlparam="&foo=bar"

worked.

I presume following this syntax I could string a bunch of parameters like this:

urlparam="¶m1=x¶m2=y"

etc?

Yes I can have just tried this...awesome!!!!


Last edited by triggersmith on Wed Aug 04, 2010 12:21 am, edited 1 time in total.

Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Arvixe - A CMSMS Partner