Welcome to Geeklog, Anonymous Friday, March 29 2024 @ 10:08 am EDT

Geeklog Forums

Block and Static Pages


Island Rokman

Anonymous
How can I get one Block to to multiple functions?
For instance I want to display a different set of instructions for each static page that is on my site father than just under the topic section. I want to include all static pages associated with the topic. So each topic full section has it's own block function.
Maybe a direct link or choice when making a block to reflect the page ID instead of or including topic. Then we will be able to specify a block for a specific page. or write a if then else statment to include multi pages.
Does anyone have any ideas to accomplish this?

Cheers
Rokman
 Quote

Status: offline

jmucchiello

Forum User
Full Member
Registered: 08/29/05
Posts: 985
You probably need the block to parse the URL in some manner. There is a function COM_getCurrentURL to get the URL. Check that the URL starts with $_CONF['site_url'] . 'staticpages/index.php?' and then parse out the page=xxxxxxxxxx part to determine what text to print.
 Quote

Island Rokman

Anonymous
yes but what i am getting at is when you try to use the block editor it doesnt allow you to pick the page it only allows to pick the topic. When testing this only brings up the ads on the main topic page of each section it does't bring them up in a block on the right side for the pages thata re linked off the main topic pages. If there was a way to either add subtopics in the Topics menu that would be recognized by the block editor then it would be much easier I think. If you go to my site http://www.loveofseduction.ca and click on any of the topic links (ie: Seduction Secrets then clik on one of the story links below you will see the next page does not display any of the ads in the right hand block. My question is how do I get those adds from the main topic page block of Seduction Secrets to show up on the pages that are linked on the page. Each Topic has it onw class of ads that will appear for each section. This will allow a variety of ad agencies to post on my site. Is that code string COM_getCurrentURL $_CONF['site_url'] . 'staticpages/index.php?' in the lib-commonfile of main Geeklog or is it in the layout files somewhere or where am I suppose to insert it with in that code in the lib-common file?
 Quote

Status: offline

jmucchiello

Forum User
Full Member
Registered: 08/29/05
Posts: 985
How does your ad block work? Is it looking for ?topic=foo& in the URL? topic is not a variable that GL spends any time ensuring you can find. It's very contextual and staticpages is not one of those contexts where the code doesn't care about the topic.

Also remember staticpages are a plugin, the block editor has no concept that there are such things as staticpages.

You seem to want hierarchical topics. GL only supports a single level of topics.

COM_getCurrentURL is in lib-common.php. I'm assuming that your ad blocks are phpblocks that you've included in your lib-custom.php. That code could get the current URL and attempt to detemine the topic by querying the topic from the staticpage.
 Quote

All times are EDT. The time is now 10:08 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content