Loading


Advertisement:

Author Topic: how to call a custom dynamic page  (Read 835 times)

jorge.yoma

  • Full Member
  • ***
  • Posts: 127
how to call a custom dynamic page
« on: January 13, 2015, 06:08:57 pm »
Hi.

I want to call a page ┬┤marketing.php' after the user post a listing. I've created the hook in the plugin and it works.

osc_add_hook('posted_item','wgt_marketing')

I want to call the marketing.php page from the function

function wgt_marketing ($item=''){


}

with information of $item, but I can't make it work. I read the routes examples and nothing.This is what I did:

osc_add_route('dynamic-route', 'dynamic-route/([0-9]+)/(.+)', 'dynamic-route/{my-numeric-param}/{my-own-param}', osc_plugin_folder(__FILE__).'marketing.php');

function wgt_marketing ($item=''){
header('Location: ' . osc_route_url('dynamic-route', $item));
}


I got the "400 Bad Request"

With this issue clear I'll be able to go ahead with my page, please help!.

B/R

design

  • Hero Member
  • *****
  • Posts: 2632
  • Osclass 3.5 MAC/PC w/ Modern Browsers
Re: how to call a custom dynamic page
« Reply #1 on: January 13, 2015, 07:47:57 pm »
basically you made a plugin. so if you follow the direction of making a plugin, you'll get it.

or

you could use the templates "custom.php"(in your theme folder) call it "page-marketing.php"

go into admin > pages> create new> give it a title> internal name should be in lower case "marketing"

select the footer link so you can get that pathway

or
there is probably another way to do this too @

doc.osclass.org

jorge.yoma

  • Full Member
  • ***
  • Posts: 127
Re: how to call a custom dynamic page
« Reply #2 on: January 13, 2015, 08:31:35 pm »
Its too simple.

I just include marketing.php, the $item information will be available. Kind of different from java...

B/R.

GerryAbz

  • Newbie
  • *
  • Posts: 43
Re: how to call a custom dynamic page
« Reply #3 on: September 22, 2017, 05:58:56 pm »
basically you made a plugin. so if you follow the direction of making a plugin, you'll get it.

or

you could use the templates "custom.php"(in your theme folder) call it "page-marketing.php"

go into admin > pages> create new> give it a title> internal name should be in lower case "marketing"

select the footer link so you can get that pathway

or
there is probably another way to do this too @

doc.osclass.org

No longer works. Just shows header and footer, no content.