apeisa Posted December 12, 2011 Share Posted December 12, 2011 I have some problems to get selectors working. <?php // This works: $this->pages->get("template=admin,name=completed"); // This doesn't work: $psi = $this->modules->get('SettingItem'); $this->pages->get("template=admin,process=$psi,name=completed"); // Doesn't work: $this->pages->get("template=admin,process=SettingItem,name=completed"); I have admin page with process called "SettingItem" selected. Link to comment Share on other sites More sharing options...
Soma Posted December 12, 2011 Share Posted December 12, 2011 I thought this should work, but not sure why you want to get page by process. I now there's $page->process to get but why can't you just use name? Do you have multiple pages with the same process? Maybe possible to use a prefix in the name and do a search "name^=prefix" to get all. ? Link to comment Share on other sites More sharing options...
ryan Posted December 12, 2011 Share Posted December 12, 2011 I hadn't really considered this particular Fieldtype as one that would be used for searching, so that's something we may need to upgrade in FieldtypeModule. However, I think that this should work right now: <?php $id = wire('modules')->getModuleID('SettingItem'); $this->pages->get("template=admin, process=$id, name=completed"); Link to comment Share on other sites More sharing options...
apeisa Posted December 12, 2011 Author Share Posted December 12, 2011 I now there's $page->process to get but why can't you just use name? Do you have multiple pages with the same process? Maybe possible to use a prefix in the name and do a search "name^=prefix" to get all. ? I want to be sure to get the right page. I don't want to make any assumptions that there won't be admin pages with same name or that some of the names on path won't change (although this would be pretty edge case to be honest). Ryan: Thanks! I think that is well enough, no need to make changes because of this. I'll let you know if it doesn't work. 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