1
nmshah
Block on a specific page
  • 2010/8/26 13:40

  • nmshah

  • Just can't stay away

  • Posts: 556

  • Since: 2007/7/2 8


Is it possible to display a specific block only on one article in publisher module? I understand this is not possible using the blockadmin in xoops but is there anyother way may be using a hack or a plugin to do this.

Xoops version 2.4.5
Php version 5.2.8
Publisher version 1 alfa

2
jimmyx
Re: Block on a specific page
  • 2010/8/26 16:30

  • jimmyx

  • Quite a regular

  • Posts: 338

  • Since: 2007/7/18


try defacer from trabis and put the code in publisher template

eg

if this page
{
ur blocks (defacer code/blocks anywhere code)
}

3
nmshah
Re: Block on a specific page
  • 2010/8/26 18:01

  • nmshah

  • Just can't stay away

  • Posts: 556

  • Since: 2007/7/2 8


thanks jimmy,

If you can further guide me with what should the code look like if the url of the page where i wish to display the block is
http://swayamsat.org/company.item.27/Dr-Gaurav-on-clinical-hypnotherapy.html

and the block id from blockadmin in xoops is 125

4
jimmyx
Re: Block on a specific page
  • 2010/8/26 18:17

  • jimmyx

  • Quite a regular

  • Posts: 338

  • Since: 2007/7/18


maybe there is other easy way

but in one my site i did it like this

i use the title of the publisher page/item

put this in publisher_item.html or company_item.html something like that

try
<{if $item.title=='Dr. Gaurav Kulkarni writes about his experience of the hypnosis course'}>
<{
$xoops_block_125.content}>
<{/if}>


i think you get the idea

rmber to read defacer readme



5
nmshah
Re: Block on a specific page
  • 2010/8/26 18:29

  • nmshah

  • Just can't stay away

  • Posts: 556

  • Since: 2007/7/2 8


thanks a lot will try this in publisher right now,

also is there a way to do this by matching the url as I can then apply it in other modules if the need so arises based on the url of the page

6
tcnet
Re: Block on a specific page
  • 2010/8/26 20:55

  • tcnet

  • Friend of XOOPS

  • Posts: 297

  • Since: 2006/5/12


<{$xoops_requesturi}> returns the url of the current page. if $xoops_requesturi = your articles url then show the block.

Try something like this in the module template:
<{if $xoops_requesturi== "http://swayamsat.org/... linical-hypnotherapy.html"
}> 
<{
$xoops_block_125.content}>
<{/if}>

7
kris_fr
Re: Block on a specific page
  • 2010/8/26 21:11

  • kris_fr

  • Theme Designer

  • Posts: 1009

  • Since: 2005/12/31


hi,
<{if $smarty.server.PHP_SELF=='linkmypage.php'}><{$xoops_block_125.content}><{/if}>


@+

8
nmshah
Re: Block on a specific page
  • 2010/8/26 21:20

  • nmshah

  • Just can't stay away

  • Posts: 556

  • Since: 2007/7/2 8


thanks a lot tcnet and kris. Never knew this was possible and in so many ways. Thanks again

9
alleymize
Re: Block on a specific page
  • 2010/10/19 10:53

  • alleymize

  • Just popping in

  • Posts: 17

  • Since: 2008/1/25


Not sure if anyone will answer but this works for inserting a certain block on a page but what would I use if I wanted to NOT have a block on a certain page? Thanks for your time and help.

10
ghia
Re: Block on a specific page
  • 2010/10/19 12:08

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Use the 'different from' equation:
<{if $smarty.server.PHP_SELF!='linkmypage.php'}>
  <{
$xoops_block_125.content}>
<{/if}>

Login

Who's Online

146 user(s) are online (109 user(s) are browsing Support Forums)


Members: 0


Guests: 146


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