Jump to content

Search the Community

Showing results for tags 'page'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

  1. Hi, How do you implement a holder/page pattern in Processwire. The idea is simple. One page type manages the list view, and usually contains very little native content. The primary function of this page is to provide a list of its child pages, providing a brief summary for each one, along with a link to its detail view. A second page type will represent the detail view for any given child page, which will typically have a custom template and content fields that make up its identity. Think of it think like a news listings, image galleries, even a Twitter timeline.
  2. Hi, I have a simple question. I need to do additional logic right after a new page has been created/saved, to be more specific I need to call an API with the value of some of its fields, is this possible in process wire? Thank you!
  3. I need to save order for elements in global tree after using "page" fieldtype in other page. It's better to look on image attacheted to understand. I wish to know the better and easiest way to solve it or <code> example ! Thanks
  4. How could i accomplish this? I would like to have in the admin a second page navigation and I would like to able to move some elements from the default page navigation to the other one. The element and their children. Any ideas on this?
  5. Hi there, This is a follow up question from my Page/Category question. https://processwire.com/talk/topic/10738-categories-not-visible-incorrect-setup/ I have a reference to the Category page I want to test membership for : $catgoryPage = $pages->find("parent.id=[path=/categories/, include=unpublished], title=$category"); I want to test if a particular page's field, Category (type:Page Fieldtype) == $categoryPage. I've been trying for the last hour on how to test membership for this page object without any success. I have tried 1) using the find method but I'm not sure how I can describe a field category == $categoryPage 2) looping through a PageArray, get the fields Array and using the has method on it. $testPages->fields->get("category")->has($categoryPage) 3) I have tried to search the forums but have found none related to my issue. Am I approaching this problem incorrectly or is there a simple answer to this? Thanks in advance
  6. In my home.php (a template, as you'd expect for the homepage) then I take a look at the URL segments. I want to provide some shortlinks, e.g. example.com/php redirects to example.com/languages/php/. That all works. But if I want to display a 404, by using "throw new PageNotFoundException();" then things go pearshaped: Fatal error: Cannot redeclare renderNav() (previously declared in /var/www/pw/public_html/site/templates/_init.php:20) in /var/www/pw/public_html/site/templates/_init.php on line 20 I'm not sure how to get around this? (or exactly why it's coming up) This is the case if I try to declare a 404 at the top of any template.
  7. I'm trying to modify the property 'path' for a specific Page (User, actually) using the following code: $this->addHookAfter("Page::path",$this,"modifyUserPagePath"); AND public function modifyUserPagePath(HookEvent $event){ $p = $event->object; if($p->template == "user" && $p->hasRole("ambassador")){ die("MODIFY THE PATH HERE WITH PREFIX FOR THE CURRENT VIEWING PAGE"); } } But i'm not able to retrieve the page that is currently running (as in, the page in the browser url). Please note I'm also using the render() method to render subpages content. I don't need the subpages url but only the original $page requested. Is there a pretty way to do this (besides looking it up via $_SERVER['REQUEST_URI'] )?
  8. Hello to all of you, has anybody suffered from following: I do something like that: $nr = $page; $nr->of(false); $nr->foo= $bar; $nr->foo2 = $bar2; $page->save(); $p = new Page(); $p->of(false); $p->template = 'foobar'; $p->parent = $pages->get('/bar/'); $p->title = $bar; $page->save(); then populate some more fields and again $page->save(); Everything is working fine and my created confirm save message pops up....the page is saved, but there are 3 outputs giving me $page->title after saving on the frontend. It has something to do with the save method, because when I leave them out everything is working just as designed... Hopefully somebody has advice! Regards
  9. I have a bunch of child pages added to a parent section called 'Projects'. These are all being looped out on an overview; for example: <?php $projects = $pages->find('template=project-detail, sort=sort'); ?> <?php foreach ($projects as $project) : ?> These pages will become quite long overtime, but I want to add a 'featured' option to them so they add a class to their element if they are 'featured'. Normally I would just add a tickbox so if it's ticked, it adds the class etc. However, as there are going to be so many pages, looking through them all and maintaining this (as the 'featured' option will change often) will get a bit messy. So, I've created a 'Page field' for the overview, so you can choose which pages you want as 'featured' and remove them easily. However, I'm having an issue working out how I can tell the child page that it has been 'chosen' to be featured, if you see what I mean? How can I, within the $projects loop, cross reference it with the 'featured' page field on the overview, and if they match, add a class? For example <?php $featured = $pages->get('template=home')->featured_items; ?> // Getting an array of the featured items <?php $projects = $pages->find('template=project-detail, sort=sort'); ?> <?php foreach ($projects as $project) : ?> <div class="item <?php if ( $featured->id == $project->id) : ?>featured<?php endif; ?>"></div> // Checking if the featured id contains project->id <?php endforeach; ?> I know the above isn't right, but you get the idea. Can you help at all?
  10. Hi, I have created a post-like structure like this: Page: Posts Page: Category Posts has a field called "category" which is derived from the Category page's children - these children simply have a title field e.g. ("Events", "News" etc) I would like to filter the children of Posts based on this field, something like this: $posts = $pages->get('/posts/')->children("category=events"); However category is a number, in my case Events is the number 1014. Obviously I want to filter by a string instead. How can I do this? Thanks in advance for your help! /////////////////////////////////////// Apologies, after I wrote this I saw a related page at the bottom. Here is the solution for completeness: http://processwire.c...a-selector-tag/ $category = $pages->get("/category/events/"); $posts = $pages->get('/posts/')->children("category=$category"); Nice and easy
  11. Hello Everyone! I have a page set up (Projects Page) on a site with a repeater field. Many items have been inserted in this page (projects). Suddenly the page can't be edited anymore, meaning, whenever i hit the "Save" button it will redirect me to the same page with no modifications, it's not possible to edit, delete or add any more items in any of the fields in the repeater on this specific page, all other pages are working normally. Help please!!!! Thank you! Julian
  12. I can't seem to remove a template, I have a template called sitemap - and it reckons it's used by 1 page, however that page has been deleted yet it's not reflected - the 'search' filter also shows up no pages using that template, yet the template still things it's in use. Any way to fix this? cPanel with PW 2.6.1 regards John
  13. Hi. I am trying to create a button on specific admin pages, that when pressing this button, it creates and publishes a new page with some of the input data from the current page. I have been able to add a button to the admin pages with this code in the admin.php template file: $page->addHook('ProcessPageEdit::buildForm', null, 'addButton'); function addButton(HookEvent $event) { $page = $event->arguments(0); $href = wire()->config->urls->admin.'page/add/?parent_id=1089&credit='.$page->credit->value.'&partner='.$page->partner->value; $field = wire()->modules->get('InputfieldButton'); $field->attr('id+name', 'create_new_log'); $field->attr('class', $field->class); $field->attr('value', 'Create new log'); $field->attr('href',$href); $event->return = $event->return->append($field); } require($config->paths->adminTemplates . 'controller.php'); I have attempted to add some url parameters, but this method does nothing good. Is it possible to do what I am trying to do?
  14. I have a system set up in processwire whereas I have an Editor role that can edit content of pages. On my site I have pages like the Home Page, Contact Us, etc, whereas I want them to be able to edit the page content. On the other hand, I have a page set up with children for a product gallery that I want them to be able to add, edit and delete categories and products within each category. For example: (edit only) Home [edit] Contact Us [edit] Product Categories ..... Celing Fans [edit] [add] [delete] ............ ceiling fan #1 [edit] [add] [delete] ..... Lamps [edit] [add] [delete] ............. lap #1 [edit][add][delete] And so on. In my Editor role I enabled page-delete, however, I want page-delete not to show up on the home page, contact us, only in the product category and product pages. Any help is appreciated. thanks,
  15. Is there a way to lock down (via role) the ability to update / publish a page live? My client needs some people to be able to edit a page, but the page changes must be reviewed by another member of staff who have access to push the update live. Is this possible? Thanks
  16. Short version Can we make the Page fieldtype as the tagging engine for images? Long version / real example I started using image tags for the first time after reading making efficient use of fields in PW. There's a part titled Use multi-file fields to replace several single-file fields where Ryan mentions tagging. As I was building a site for an interior designer, I needed an almost identical setup and to tag images with a gallery with "basement", "living room", "garden" and "kitchen" tags. At one stage, my client wanted "basement" changed to "basement and garden" and I had to manually edit about 15 images. No big deal really but it doesn't seem very scalable. Having used the Page fieldtype for tagging blog posts and news and experienced how easy it is to make global tag names changes etc, I wondered if the Page fieldtype could be put on the roadmap as the tagging engine for images or at least as an option.
  17. My site structure is something like this: parent item 1 --sibling --sibling --sibling --sibling parent item 2 parent item 3 Within parent item 1, I have a menu that navigates to each sibling page like this: <nav> <ul id="pages"> <li><a class="previous" href="<?php echo $page->prev->path; ?>">prev</a></li> <li><a class="next" href="<?php echo $page->next->path; ?>">next</a></li> </ul> </nav> What I would like to do is change my li class when ever a user would get to the first and last sibling page. Does anyone know how I can do that?
  18. Hey guys, So First Structure: Home [template=home] --Category [template=collection_list] ---SubCategory [template=collection_category] ----Articles [template=collection_basic] Each 'Articles' has a field called 'thumbnail' and 'banner'. I want to grab the latest article under a category and output the thumbnail and the banner. I'm quite new to PW (loving it so far) and I'm hoping you guys will be able to support me here.. I know it needs to look something like this... var_dump($pages->find("template=collection_basic, limit=1, sort=id")->thumbnail); ... Yes that's my var_dump but it's returning an error so. Would appreciate any help!
  19. Hi guys, I have a little issue I debugged as far as I could for the moment. I have a simple page (title, a checkbox, a textarea and the comments field) working as a guestbook page. Initially there were no problems with creating the page and setting the content of title and the textarea field. Currently some comments have been made on the page. Now I want to change the content of the textarea field, but sadly nothing is happening in the administration area. The green bar saying "successful saved" (or something like that) does not appear. I checked the mysql log file, and also reassured my of the normal behavior on a different page without comments, how the log must be look like. So I found, that really nothing is happening. No insert statement. I don't think this is the expected behaviour, but I'm not sure how to fix this issue or debug this some more. Hope you can help me out here. My environment installation looks like the following: ProcessWire Core (Stable/Master) 2.5.3 JqueryDataTables 1.9.4 ModulesManager 2.1.6 ProcessDatabaseBackups 0.0.3 ProcessLatestComments 0.0.3 ProcessWireUpgrade 0.0.3 TemplateDataProviders 1.1.0 TemplateTwigReplace 1.0.9
  20. Hi, I'm trying to setup a page field with a custom selector. Intention is to show only pages of the currently logged in user in the select drop down. Here's what I tried in the field setup: I also tried But I guess this doesn't make a lot of sense because when the page is created and has not been saved yet, the $page->createdUser isn't there yet. I always get an empty select It seems like the page field is not aware of the $user object. Is there any way how I could filter the pages by created_users_id, maybe through a hook on that field?
  21. Hello, I've a requirement where I need to have a list of pages using same template available on a page (site settings page) through page field. Basically what I need is, whenever a new page of specified template has been created, it should be automatically added to that pages list, just like home page has children. For example, I've a template called article. Articles are posted under /blog/ page. I've a site settings page which has a page field called articles_list which I use to manage articles list on some other page. This way I can manually chose what articles I want to show and in which sorting order. There's no specific sorting logic to this. So what I need is, whenever a new article is posted, it should automatically be appended on that articles_list page field so the site moderator can manually change the sorting without having to add page himself and then select the sorting. I've this weird requirement cause the site moderator can't see which new article has been added to the blog, he's just allowed to set the sorting. I hope I've clarified the requirement. I think I can use admin custom pages but it for some reason never worked for me. Thank. P.S. Forgot to mention that to add post or any other related task, I'm not using front-end, it's all through PW's admin panel.
  22. Short version: Can a Page select field be used to select content from itself? Long version: A client of mine has a Pages A, B and C and uses a Page select field to pull in content from other pages to a Promo area. Mostly, this consists of a thumbnail promo title promo description and I have it working great assuming those fields on the source page are completed. The issue I have is sometimes the source of those fields is the actual page. IE On Page A we're not pulling in content from Page A and not sourcing it from Pages B or C. The "usual" way to do this is of course to fallback to the page API <div class="promo-container"> <img class="promo-image" src="<?=$page->Promo_Image->getThumb('crop-for-promo') ?>" /> <div class="promo-title"><a href="{$page->url}"><?=$page->Promo_Title ?></a></div> <div class="promo-desc"><?=$page->Promo_description ?></div> </div> But I wondered why a Page select field can't output the contents of it's own page. It'll allow me to select itself but doesn't output anything. If it helps, here is my code although it's working fine in general. <!-- START Promo for Innerpages--> <?php foreach ($page->Promo_Picker->find('limit=1') as $promo){ echo " <div class=\"promo-container\"> <a href=\"{$promo->url}\"><img src=\"{$promo->Promo_Image->getThumb('crop-for-promo')}\" /></a> <div class=\"promo-title\"> <a href=\"{$promo->url}\">{$promo->Promo_Title}</a> </div> <div class=\"promo-desc\"> {$promo->Promo_description} </div> </div> " ;} ?> <!-- END Promo for Innerpages-->
  23. Hello all, So me being a noob can't figure out how can I use $pages->get or find in my custom function. function printTitle($page_id){ echo "Title of the page is ".$pages->get("id={$page_id}"); } Above code is giving me error : Error: Call to a member function get() on a non-object From what I've read probably, I should be using $wire('pages')->get. But this gives following error: Error: Function name must be a string Removing $ from wire solves above error but it doesn't print anything. Any help would be very much appreciated. Thanks a lot.
  24. Hi folks, I have a simple Page field setup to act as a tag system. This has worked for me, but for some reason it's not working now and I can't find out why. I can select previously added 'Pages' here, but cannot add new ones (comes up with a little warning symbol (see attached)). Any way I can check through to see what I have changed to affect this? Debug mode? What should I be looking for? I have tried to test it alongside another project with a similar setup that still works but all seems to be the same? Thanks guys, R
  25. Hi, From the processwire page tree listing, I am getting a strange error SQLSTATE[HY000]: General error: could not call class constructor I am looking at http://blog.boringguys.com/2010/11/sqlstatehy000-general-error-could-not.html when I noticed the same. I have added a few fields and upgraded to latest version of PW in dev branch. Any help to fix the page tree is appreciated. Thank you
×
×
  • Create New...