-
Posts
18 -
Joined
-
Last visited
Enver's Achievements
Jr. Member (3/6)
0
Reputation
-
Here is a final changes //template "addassets" is where are assets information (Serial, Model, Name, Make ) //template "user" is for users and this template have field "Page" with name "user_select_asset" where i am using also this code in INPUT > PHP Costume Code. $assets = $pages->find("template=addassets"); $UserAssets = $pages->find("template=user, user_select_asset.count!=0, include=all")->remove($page); foreach($UserAssets as $AssetSelected) { foreach($AssetSelected->user_select_asset as $userA) { $assets->remove($userA); } } return $assets; in output when i edit a User in field Select Asset "user_select_asset" i can see all assets and i can select one, ok I selected asset with name "Asset1" good and I save a page, than I go to the second user Page to select other asset related to this user there is still Asset1 but some others now is not showing like Asset5 and 6. thanks.
-
I removed that part but still error and not working selected to skip.
-
I am doing something like this $user_select_assets = $pages->find("template=addase"); $borago = $pages->find("template=user, user_select_asset.count!=0")->remove($page); foreach($borago as $bora) { foreach($bora->user_select_asset as $snow) { $user_select_assets->remove($snow); } } return $user_select_assets; but i have some warning Invalid argument supplied for foreach() in /public_html/wire/modules/Inputfield/InputfieldPage/InputfieldPage.module(116) : eval()'d code on line 5
-
How to add that code there is any sample I tried to find on forum something related but not sure so if you can put me on road with some short code Thanks.
-
Hello I have field Page Select its possible in output select pages which are selected on any user don't show in select example Field Page which have inside template addAsset to get all pages related to this template Select ----Asset 1 ----Asset 2 ----Asset 3 ----Asset 4 if i have selected Asset 2 (in template User where is this field) don't show it anymore on select page field to skip it Select ----Asset 1 ----Asset 3 ----Asset 4 Thanks.
-
Thanks i just did it before 10 minutes after i tested the code Thanks again for everything here
-
Sorry for all of this i made here but now its everything working how i wanted i read some posts and other stuff mix some stuff @Macrura did on post and in the end i found it work trying different ways, this is a code fixed my trouble $findmylisting = $pages->find("id!=40, template=user, sort=name"); foreach($findmylisting as $f) { $stateAdd = $pages->get("$f->state")->title; echo '<p>'; echo $f->fullname . " | "; echo $stateAdd . " | "; echo $f->resourceType . " | "; echo "("; $gewt = $pages->find("template=addProject, projectManager=$f"); foreach($gewt as $demos) { echo $demos->profName->title . ", "; } echo ")"; echo '</p>'; } Thanks Martijns and Macrura .
-
and where to use it its calling state from user profile (New Your, Florida etc...)
-
Thanks Martijn and Macrura here is a code what i did and is query exactly what i looked for $findmylisting = $pages->find("id!=40, template=user, sort=name"); foreach($findmylisting as $f) { $stateAdd = $pages->get("$f->state")->title; echo '<p>'; echo $f->fullname . " | "; echo $stateAdd . " | "; echo $f->resourceType . " | "; echo "("; $gewt = $pages->find("template=addProject, projectManager=$f"); foreach($gewt as $demos) { echo $demos->profName->title . ", "; } echo ")"; echo '</p>'; } output Gent Gatoro | New Jersey | Direct | (Sanofi, Catalent, ) Demo Strato | New Jersey | Direct | (Sanofi, Catalent, Spice,) Grov Avat| New Jersey | Direct | (Sanofi, ) Bench Datop | New Jersey | Direct | (Alexd, Howsr, )
-
Now is outputting but is repeating same value from first user here is code $findmylisting = $pages->find("id!=40, template=user, sort=name"); foreach($findmylisting as $f) { $stateAdd = $pages->get("$f->state")->title; $gewt = $pages->get("template=addProject"); echo '<p>'; echo $f->fullname . " | "; echo $stateAdd . " | "; echo $f->resourceType . " | "; echo $gewt->profName->title; echo '</p>'; } do i need to use foreach inside foreach or just a search using api this is output Andy Bamos | New York | Direct | Demo1ProfName Gana Fisher | New York | Direct | Demo1ProfName Art Demo | New Jersey | Indirect | Demo1ProfName Ash Khurta | New Jersey | Direct | Demo1ProfName
-
This what i am trying to get is similar to http://processwire.com/blogtest/categories/ you have categories name and under them you have pages they have selected different categories lets say we have category: Best Practices and in this category we have different pages this is same what i am trying to get beside categories i have users $findmylisting = $pages->find("id!=40, roles=superuser, template=user, sort=name"); foreach($findmylisting as $f) { $stateAdd = $pages->get("$f->state")->title; //State Field Page select(/states/...) State in user template echo '<p>'; echo $f->fullname; //user Full Name Field echo $stateAdd; echo $f->resourceType; //Resource Field Page select(/resource/...) in user template echo $f->ProfName; //Field ProfName page Select(/admin/access/users/...) in addProject template not in user template echo '</p>'; }
-
Everything is calling fine user info in front end you need to be login to get this info everything at this point is fine i am getting all datas from user information which use template user, here is another template called "addProject" inside this template is field called "ProfName" field type Page on this field i can select one user which is under "/admin/access/users/" what i am trying to call is: find users, list them and find Project Name where is selected this user on addProject, sample: template addProject ------------Project1 (Field(ProfName)has selected "user1") ------------Project2 (Field(ProfName)has selected "user1") ------------Project3 (Field(ProfName)has selected "user2") ------------Project4 (Field(ProfName)has selected "user3") ------------Project5 (Field(ProfName)has selected "user4") find users (template user) user1 "Project1 + Project2" user2 "Project3" user3 "Project4" user3 "Project5" Thanks for your time trying to help me on this.
-
The problem is this field is not at template "user" where i am using find $findmylisting = $pages->find("template=user, sort=name"); this filed is at "AddProject " template every post on this template can select a user which is added at user template
-
Field "ProfName" type "page" is field on page template addProject from this field you can select user so is Select the parent of the pages that are selectable. user1, user2, user3 ...
-
$findmylisting = $pages->find("id!=40, roles=superuser, template=user, sort=name"); foreach($findmylisting as $findit) { $stateAdd = $pages->get("$findit->state")->title; $resourceTypeAdd = $findit->resourceType; $getTest = $findit->pageSelect->ProfName; echo "<p>{$findit->fullname} - {$getTest} - {$stateAdd} - {$resourceTypeAdd}</p>"; } output Notice: Trying to get property of non-object in /home/drit/domains/demo/public_html/site/templates/test.php on line 10 John Smith - New Jersey - Direct Notice: Trying to get property of non-object in /home/drit/domains/demo/public_html/site/templates/test.php on line 10 Parker Demo - New York - Direct