sakkoulas Posted May 31, 2013 Share Posted May 31, 2013 Hi everyone, i am a little confused is it possible for a widget to show the id of the page that render it? so the widget can have a selector that filters results by the id of that particular page? thanks. Link to comment Share on other sites More sharing options...
Harmster Posted May 31, 2013 Share Posted May 31, 2013 What exactly do you mean with Widget? I've never used a thing called widget.... But if you render a page with $page->render(); why not echo $page->id? Link to comment Share on other sites More sharing options...
diogo Posted May 31, 2013 Share Posted May 31, 2013 @Harmster, he means the ID of the page from where render is called. @sakkoulas, you can use any of these techniques http://processwire.com/talk/topic/3660-what-page-was-the-caller-of-render/ 1 Link to comment Share on other sites More sharing options...
sakkoulas Posted May 31, 2013 Author Share Posted May 31, 2013 thanks guys. diogo, How did I miss this? all morning i'm searching the forum for a post like this thanks again Link to comment Share on other sites More sharing options...
sakkoulas Posted May 31, 2013 Author Share Posted May 31, 2013 I ended up with this $categoryUrl = $_SERVER["REQUEST_URI"]; $categoryToRender = explode("/", $categoryUrl); $category= $pages->find("categories.name=$categoryToRender[2]"); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now