11
alleymize
Re: Block on a specific page
  • 2010/10/19 13:54

  • alleymize

  • Just popping in

  • Posts: 17

  • Since: 2008/1/25


I am good at editing but not at creating php, sorry. So the reply you posted with the code, does that include the different from equation? I tried it by pasting it into the index page of my module, i.e wfchannel_index.html and it did not work. I entered my page of course in the link area and I changed the number of the block to xoops_block_89.content which I got this number from going into the admin and looking at the link for the block that I want removed on the specific page. Am I doing something wrong? Thanks again for your help.

12
alleymize
Re: Block on a specific page
  • 2010/10/19 19:32

  • alleymize

  • Just popping in

  • Posts: 17

  • Since: 2008/1/25


Can anyone help me with what the guy just said above about the different than equation and my comments after??

13
ghia
Re: Block on a specific page
  • 2010/10/20 8:26

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Yes Kris used equal == and I not equal != in the proposed code.
If your code was working for showing the block on a particular page, it should work with the code change for showing on all pages except the that particular page.

14
alleymize
Re: Block on a specific page
  • 2010/10/20 9:51

  • alleymize

  • Just popping in

  • Posts: 17

  • Since: 2008/1/25


So the == makes it show and the != makes it not show correct? But am I getting the block id correct by just looking at the link in the admin because I have tried both but neither work for me. Here is the code I am trying to use to hide the block:

<{if $smarty.server.PHP_SELF!='https://www.hinduismtoday.com/modules/wfchannel/index.php?wfc_cid=2'}>
<{$xoops_block_89.content}>
<{/if}>

I have found the number 89 by clicking on the edit button for the block and it has a link of admin.php?fct=blocksadmin&op=edit&bid=89 So I assumed 89 was the number to use, is this correct?

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

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


I don't think PHP_SELF returns the domain. To be sure use it standalone and see what it prints on the desired page.
le="color: #000000"><?php <{$smarty.server.PHP_SELF}>

You are using the defacer module, right? Else
le="color: #000000"><?php <{$xoops_block_89.content}>

will have no effect. What do you see on the place in the HTML source code?

16
alleymize
Re: Block on a specific page
  • 2010/10/20 19:14

  • alleymize

  • Just popping in

  • Posts: 17

  • Since: 2008/1/25


If I put the code in a plain php doc and view it, it just shows the code.

I am not using the defacer module because I thought that was for something else like different themes on different pages.

I was just wanting to do a block and thought that was over the top for what I needed to do.

Any direction and or help would be greatly appreciated.

17
alleymize
Re: Block on a specific page
  • 2010/10/20 19:16

  • alleymize

  • Just popping in

  • Posts: 17

  • Since: 2008/1/25


And if I put the code inside php brackets in the file and view it it is a blank page.

18
ghia
Re: Block on a specific page
  • 2010/10/20 23:13

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


The code is Smarty and has to be used in templates or theme html files.

19
alleymize
Re: Block on a specific page
  • 2010/10/21 13:14

  • alleymize

  • Just popping in

  • Posts: 17

  • Since: 2008/1/25


Ok sorry about that. When I put it into the wfchannel index page it shows the path to the page from the root. i.e. /modules/wfchannel/index.php

Is this my problem? What is the code I need to not show a block on a certain page then?

20
alleymize
Re: Block on a specific page
  • 2010/10/28 13:24

  • alleymize

  • Just popping in

  • Posts: 17

  • Since: 2008/1/25


Can Someone Help Please??? I am not a coder and just want the code to NOT show a block on a CERTAIN PAGE in a module, not the entire module. What is the code that I would use?

Any help beyond what is above that does not work would be very greatly appreciated. Thanks for your time.

Login

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits