1
bjuti
Publisher category via smarty var
  • 2010/10/8 22:58

  • bjuti

  • Just can't stay away

  • Posts: 871

  • Since: 2009/1/7 2


Well... this is my problem.

I need to have different text/banner depending on publisher's category.

So if i do something like this:
< {if $item.categoryid == 1} >
some text
< {/if} >

Nothing happens. What should I do? Ideas?

Tnx

2
Anonymous
Re: Publisher category via smarty var
  • 2010/10/8 23:41

  • Anonymous

  • Posts: 0

  • Since:


where ? block template or page template ?

3
Tarik
Re: Publisher category via smarty var
  • 2010/10/9 1:32

  • Tarik

  • Not too shy to talk

  • Posts: 170

  • Since: 2010/2/3 1


You can try to change the condition to this
<{if $xoops_requesturi == "modules/publisher/category.php?categoryid=3" }>
some text
<{/if}>

4
bjuti
Re: Publisher category via smarty var
  • 2010/10/9 7:56

  • bjuti

  • Just can't stay away

  • Posts: 871

  • Since: 2009/1/7 2


In page template.

BTW. Tarik's hack won't work coz I use url rewrite.

5
Tarik
Re: Publisher category via smarty var
  • 2010/10/9 13:37

  • Tarik

  • Not too shy to talk

  • Posts: 170

  • Since: 2010/2/3 1


if you use url rewrite so change the url
like if you have http://www.yoursite.com/publisher/cat/3
<{if $xoops_requesturi == "publisher/cat/3" }>
some text
<{/if}>

6
bjuti
Re: Publisher category via smarty var
  • 2010/10/9 14:08

  • bjuti

  • Just can't stay away

  • Posts: 871

  • Since: 2009/1/7 2


What if:
website.com/t.item.12/article-rewritten-name.html

and

website.com/t.category.1/category-rewritten-name.html?

7
Tarik
Re: Publisher category via smarty var
  • 2010/10/9 14:30

  • Tarik

  • Not too shy to talk

  • Posts: 170

  • Since: 2010/2/3 1


first try this code you have nothing to lose
<{if $xoops_requesturi == "modules/publisher/category.php?categoryid=3" }>
some text
<{/if}>

if it doesn't work
the dimpliest way is to enter your category by browser
and compy every thing after yourwebsite.com/extra
and take the
<{if $xoops_requesturi == "extra" }>
some text
<{/if}>

8
bjuti
Re: Publisher category via smarty var
  • 2010/10/9 16:26

  • bjuti

  • Just can't stay away

  • Posts: 871

  • Since: 2009/1/7 2


It doesn't work (first case)

About the second.. how to do id coz on item page there is no category in url?

I need eg if category called 'Xoops', on the top of every item of Xoops category to be some text or banner, and again for second category 'cars' to have banner for car, and every item fo the category.

Coz if I use url rewrite:
<{if $xoops_requesturi == "extra" }>
some text
<{/if}>


How the code will know in witch category the article is? :)

9
bjuti
Re: Publisher category via smarty var
  • 2010/10/12 9:05

  • bjuti

  • Just can't stay away

  • Posts: 871

  • Since: 2009/1/7 2


Any other idea?

10
Tarik
Re: Publisher category via smarty var
  • 2010/10/13 13:06

  • Tarik

  • Not too shy to talk

  • Posts: 170

  • Since: 2010/2/3 1


for example from one of your sites
http://www.carownersmanuals.net/
when i enter in a the category Mercury Owners Manual
the link in the web-explorer is
http://www.carownersmanuals.net/manuals.category.33/Mercury-Owners-Manuals.html
so the smarty condition is
<{if $xoops_requesturi == "manuals.category.33/Mercury-Owners-Manuals.html" }>
some text
<{/if}>

Login

Who's Online

381 user(s) are online (270 user(s) are browsing Support Forums)


Members: 0


Guests: 381


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits