Jump to content

John W.

  • Posts

  • Joined

  • Last visited

About John W.

  • Birthday June 30

Profile Information

  • Gender
    Not Telling
  • Location
    Florida, USA

Recent Profile Visitors

2,154 profile views

John W.'s Achievements

Full Member

Full Member (4/6)




Community Answers

  1. Hi, have a site where I set up a news category, then under that I have different regions where editors in those regions can add news stories. I'm trying to figure out how to allow each editor to only add/edit stories in their region, and not allow editors from other regions to edit them. example: News (template:news-category) Washington County (template:news-region) My First News Story for Washington County by Editor 1 (template:news-article) Jefferson County (template:news-region) A News Story by the jefferson county editor (template:news-article) Taylor County (template:news-region) A news story by a Taylor county editor (template:news-article) I really don't want to create 3 different news-region templates along with 3 different news-article variations, and 3 different types of Editor roles. Is there a way / module that will let me say, "jane which is an editor can only add and edit to Washington County" and "bill which is an editor can only add or edit to Taylor County", etc? Also, it would be nice to allow the "home office" editor to add/delete/modify contents created by the other editors, a "Super Editor" if you will. Thanks mucho!
  2. Thanks. I used your suggestion. I also have a Region page reference, for like counties, in each Business listing. Whereas I can also list by region -> main category -> subcategory. It was a bit tricky, but, I got it and learned a few more PW methods along the way. 🙂 cheers! 🍻
  3. Hi, I've tried a good while to come up with a solution to this, but, it's driving me nuts. Maybe someone could help? I have 3 categories. All Business Dr. Adams Dr. Smith Mary's Flower Shop Primary Categories Physicians Gifts Secondary Categories General Practice Mental Health Flowers Both Doctors have a page reference fields to the Primary Category->Physicians However, Dr. Adams has a page reference to Secondary Categories->General Practice, and Dr. Smith has a page reference to Second Categories->Mental Health In short, using this method I can assign multiple primary and secondary categories using Page References, to each business. The trouble I'm having is I'm trying to output only the Primary and Secondary categories that are in use by any businesses, without duplicating the Primary categories, like so: Physicians General Practice Mental Health Gifts Flowers I've been using a call like this: $businesses = $pages->find("template=business-directory-abusiness,bus_region=$region,bus_cat_1=$maincat,bus_cat_2=$subcat")->unique(); Where my problem lies, is this causes the below, but, I'm trying to group them as shown above. Physicians General Practice Physicians Mental Health Gifts, Flowers I've also tried running a for loop to create an array, ($maincat=>id, $subcat=>id, $maincat=>title), then run array_unique(). Still no luck.
  4. Thanks. I haven’t learned to create hooks, guess now is a good time. 😊
  5. So, I have a page called NEWS with children that use a template named news_article. Currently I have NEWS set to list children, in the admin side, by published. Well, I added a checkbox field called pinned_article. If checked, it just pins the article to the top when listing news on the visitor side...fine. What I’m trying to do on the admin side is list in the tree all the news articles by pinned_article,published (the equivalent of a selector such as sort=-pinned_article, sort=-published) All I see is a drop down for selecting a single field Would be nice to add a text field to allow selectors for more complex sorting Any work-arounds?
  6. Hi, for some reason I’m getting the old PW login screen, as shown. Can someone guide me in replacing it with the current PW login screen (the one that does not display the PW version? I’m guessing I could copy files from another install, which has the newer login screen, uncertain what to copy. Thanks! After login, my Reno displays fine. Trying to replace/update this: My Reno theme displays fine and is ok.
  7. I think I found a quick solution: # cycles through all the current $page parents then # returns the parent that is #x in the list # $page is the current page, $parentNumber is the # parent to find and return in the tree function getParent($page, $parentNumber) { $cnt=0; foreach($page->parents() as $p) { $cnt++; if($cnt == $parentNumber) { return $p; } } return false; } #pass the current $page and return its third parent $parentPage = getParent($page,3); echo $parentPage->title;
  8. Yeah, tried that, it pulls the first child under DEPARTMENTS This doesn't work when you have several departments such as DEPARTMENTS HUMAN RESOURCES About HR Job Listings Job 1 Job 2 ADMINISTRATION About Administration EMERGENCY OPERATIONS About Emergency Operations In the case above, your suggestion would always return "Human Resources"
  9. Working on a project where I have different categories of Departments, under departments I have Offices, and each office has multiple pages. DEPARTMENTS HUMAN RESOURCES About Human Resources Job Listings job 1 details page job 2 details page ADMINISTRATION About Administration Meet the Administrator ----------------------------- stored in HUMAN RESOURCES is a background image and title of the department. Instead of creating a background image for each office page (and it's sub pages like job 1 details page), I'm using the background image stored in HUMAN RESOURCES for all the child pages. I'm familiar with using $page->rootParent, however, this will return DEPARTMENTS rather than the office, e.g. HUMAN RESOURCES that each sub page belongs to. I thought about using a recursive function to traverse from the current page, when it reaches the template "office". Basically, if I'm in job 1 details page, it would traverse back up the tree until it reaches "office" template, such as "HUMAN RESOURCES". Has anyone done something similar, but, using a built in method that I'm missing? Thanks.
  10. I don't have a php template for documents. The non-php template, for documents just holds a title, summary and has pdf attachments available for download. Therefor, when /documents/ does a query, it finds all the "document" templates and lists them with a title, summary, and links to either view or download a pdf. See this screenshot: /documents/ simply does a list like this where visitors can see a date, title, summary and download or view pdf files. the information for each entry is a php-less template with date, title, summary and a file-type pdf field for attaching the pdf.
  11. Yup, that is what I'm doing. However, the trouble is I'm using a Page Reference field in another template, which creates a link like /documents/document-category/nameofdocument Of course, it throws a 404, since "nameofdocument" doesn't exist. So, what I did, for "nameofdocument", I created a php file for that template that redirects to /documents/results/document-category/. Since /documents/results/ doesn't have a template it just treats results/ like a url segment. 😉
  12. Yeah, I understand that. I had to create a page for the document-name, simple php file that redirects to documents/results/human-resources/ my documents.php then pulls the 3rd url segment and uses that for my $pages-find() query to filter results It works. Just figured there might be another way.
  13. Hi, I've set up a structure like so: these are the templates documents -> documents_category -> documents_document Basically, when someone goes to /documents/ it creates a listbox of categories and the page then lists all the documents_document in that documents_category. In my listbox, I have the url value set to /documents/document_category for instance /documents/human-resources/ would list all the documents contained under human-resource. Herein is the problem, I just want to use the human-resources as a url parameter to pass to /documents/ rather than processwire trying to load an actual page at /documents/human-resources/documentname Right now, it goes to /documents/human-resources/documentname/ Is there a way to set processwire to treat human-resources as a url parameter and not attempt to load the child page /documentname/? Note, I added a path like /documents/results/document-category/ which works, however, I need this to work in the back-end when using a page select field. The only solution I could think of was creating a documents_category.php file that takes the url, /documents/document-category/ and changes it to /documents/results/document-category/ then does a session redirect. Using this a page select would go to /documents/document/category/ which inserts the "/results/" segment and then redirects to /documents/results/category-name Thanks!
  14. Strange, My install of Processwire on my development system is showing version 3.0.132 (shown in blue/white theme), however, on my server side shows version 3.0.123 (current) (green/brown theme)? I use the ProcessWireUpgrade module, and on the local and server side shows the same version. Anyone have ideas why? Local Machine Server Side
  15. Would it be possible to add a the title tag to the iframe in order to improve accessibility? for instance <iframe title="A welcome from our CEO" ... thanks!
  • Create New...