Jump to content

Search the Community

Showing results for tags 'pages'.

  • 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. I am trying to create a sort of database system using ProcessWire. I don't want all the data to show up as pages on the website but instead pull it into pages. Similar to the Skyscrapers demo except in that one the data shows up as pages. The data I wish to store is information about types of moths. So family, sub-family, genus and species. Each of these has information associated with it. For example, species has name, images and distribution. This is another example of information about the species. Initially, I attempted to do this using nested repeaters. This appears to work but I feel there is a better and more elegant way. Additionally, this page says: So I then tried using pages with children, but this also didn't work well. I had to make every single page unpublished as I don't want them showing up in menus and other places. This means they all have strikethroughs in the admin tree which is very annoying. Is there a better way of handling this kind of data in ProcessWire or is this maybe not a suitable project for ProcessWire? I apologise if this is a silly question, but I could not find anything on this matter and am still new to ProcessWire.
  2. Hello! I have a strange problem with the "delete" method of the "pages" API-variable: When I insert a parent- and a child-page, and then immediately try to delete first the child- and then the parent-page, an exception is thrown telling me that the parent cannot be deleted, because it still contains a child-page. You can reproduce this behaviour using the following code: <?php require 'index.php'; $parentPage = new ProcessWire\Page; $parentPage->name = 'parent'; $parentPage->template = 'basic-page'; $parentPage->title = 'parent'; $parentPage->parent = $pages->get('/'); $parentPage->save(); $childPage = new ProcessWire\Page; $childPage->name = 'child'; $childPage->template = 'basic-page'; $childPage->title = 'child'; $childPage->parent = $pages->get('/parent'); $childPage->save(); $pages->delete($pages->get('/parent/child')); $pages->delete($pages->get('/parent')); (I put this code into a file called "experiments.php" in the root directory of the site, because I do not know of any better way for quickly testing out code in ProcessWire yet) Can you tell me why this code throws an exception? What am I missing? I am using ProcessWire 3. Thanks for your help! PS: Yes, I know about the second parameter in the "$pages->delete" method, but it should not be necessary to be set in this scenario if I`m correct.
  3. Hi all, I am creating a page field (field of type FieldtypePage) via the API, however im still trying to find some documentation as to how I would go about setting the Selectable Pages for said field using the API. From what I have found it looks like it involves the use of, albeit this looks like a getter rather than a setter: $field->getInputfield($page) Which looks like it would make sense if I wanted to specify the selectable pages by a parent page, but what if I wanted to specify it by say a template?
  4. When I delete a page name, e.g, /cart/, using the admin interface it goes into trash and gets the name /trash/2573.1.11_cart/ . I see that, with the Pages::trashed hook that the previous page name (previousPage) can be accessed. Where can I more information about what happens when a page is put into trash and what the name means?
  5. I have a hook that creates a page for a subset of the pages on our site. It uses the saved page's name as part of the created page's name. The problem I am having is that my hook, attached to Pages::saved(), is being called even when the page save failed because of missing fields. Is there a way I can tell that the page save failed due to missing fields? Never mind - it does succeed; it just issues warnings about required fields.
  6. Hello, I noticed that the Pages::added hook gets called twice. PW 3.0.62. To test , add this to admin.php wire()->addHookAfter('Pages::added', function($event) { bardump('added'); // needs Tracy Debugger }); Can anyone confirm this? It gives me trouble when adding a hook that skips the page add step (for users), following Pete's concept. There will always be created 2 new pages which I need to avoid. Is it a feature or a bug?
  7. I have a PW page that is about 2 - 3 Years old . After an upgrade to Version 2.6 all Pages and modules where gone in Admin backend. As i had no time to look after the page i left it like it was for quite a while. Now that i needed to get the Page online again i searched whith google anf fount that i should upgrade the page to PW 2.7.3 As the Upgrade to 2.6 was done in a hurry , its perfectly possible that i accidentallly upgraded from 2.0 to 2.6. Please have a look at the images to see the desaster in full color ....
  8. I've got this code to fetch all pages: /** @var PageArray $pages */ $pages = $this ->wire('pages') ->find(sprintf( 'has_parent!=2,id!=2|7,status<%s', Page::statusTrash )); With this I fetch all pages except admin, but that includes the 404 page as well. Is there a way to exclude pages like the 404 page from the result? Or maybe loop through the result set to check for the pages response code (without curl that is)? I want to avoid filtering the 404 page by ID if possible.
  9. I have the following import script being included in the homepage template file: <?php $mmpid = wire('pages')->get('template.name=makes')->id; // Manufacturers: $file = __DIR__.'/manufacturers.csv'; importCSV($file, 'mamo_manufacturer', $mmpid); // Models: $file = __DIR__.'/models.csv'; importCSV($file, 'mamo_model', 0, $mmpid); function importCSV($filepath, $template, $parent_id = null, $grandparent_id = null) { $csv = array_map('str_getcsv', file($filepath)); array_walk($csv, function(&$a) use ($csv) { $a = array_combine($csv[0], $a); }); array_shift($csv); # remove column header //echo '<pre>'; print_r($csv); echo '</pre>'; foreach($csv as $r) { $p = new Page(); $p->name = wire('sanitizer')->pageName($r['title']); $p->template = $template; if($parent_id !== 0||null) { $p->parent_id = $parent_id; } elseif($parent_id == 0||null) { //$parent = wire('pages')->get('title=' . $r['parent']); //echo $parent.' ';// echo $r['parent'].' '; echo $grandparent_id.' '; $parent = wire('pages')->get('title=' . $r['parent'] . ', parent_id=' . $grandparent_id)->id; echo $parent.' '; $p->parent_id = $parent; unset($r['parent']); } $p->save(); foreach($r as $k=>$v) $p->$k = $v; $p->save(); echo '<br>'; } } Output = Why is it running the ELSE when the condition for the IF is met? (the first 9 lines) All 14 models (lines past 9) are created under the first manufacturer. I've been messing with it, been able to get them to display the page IDs proper at one point for the models but still there's the standing issue of all of them being created under the first manufacturer nonetheless and also the ELSE running despite not being a condition of ELSE. What's up please...
  10. Hey everyone, Im new to process wire. Been doing some practice on this cms, and ran into problem, I have several pages, and some have children pages. Is there a way to define absolute path for children pages ? Lets say I have / /services/ /services/some-service can i set page /services/some-service/ path to be /some-service ? to loose parent path prefix from it ?
  11. Hi all, this is my first post here - so let me say first: I love ProcessWire! I have the following scenario: On my website users will be able to create their own site. This site is a page (in this case 'theirsite'): "www.mydomain.com/theirsite" Now I want that they can use their own domain. So this domain needs to load their page: "www.theirdomain.com" goes to "www.mydomain.com/theirsite" but while showing the first domain in the browser. I'm trying to archive this with an htaccess entry: RewriteCond %{HTTP_HOST} www\.retuschierenlernen\.de RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?it=retuschierenlernen/$1 [L,QSA] I get the following error, because it loads the my main site, not the page of my user: Warning: file_put_contents(/www/mysite/test/html/site/assets/cache/FileCompiler/site/templates/public-site.php): failed to open stream: Permission denied in /www/mysite/test/html/wire/core/FileCompiler.php on line 327 Thanks! Dennis
  12. Hi Everyone! Wondering if the community can help me out on the following issue I'm struggling with; I'm using a Page titled Tags, with children Pages for separate Tags (a Tag, maybe obvious, but still...) These tags are being used as...tags! From a dropdown on the article-page in the CMS. Works like a charm. But... I actually want to use these tags as cross-reference as well. Basically I want to make a page with all tags on it, and for each tag have a list with all the Pages it's connected to (and preferably even pull content from those pages). Might be I overlooked a previous post on this subject, or that there's a Module for these kind of things, but since I couldn't find anything so far, I thought I'd try my luck here! Ideas, options, solutions, suggestions...all welcome! Thanks!
  13. When you start a website from scratch and have to make both front-end and back-end of it, how do you set up your workflow? I’m a bit confused because 1) I’m new to PW 2) I’m setting up a marketplace where the vendors need to have access to the back-end, so they can manage their services/products, which will be listed in the front-end for “normal” users to buy them. More beginners' questions: What do you do first the back-end or the front-end? Is it correct to think of fields -> pages -> templates in this order? If yes/no why? Is the product page that the "normal" user see in the front-end, the same that the vendors have access in the back-end? Thanks!
  14. Hello, I've been working on building a find query and I think I need to be able to do an OR search on multiple selectors, all of which have a number of possible values. The first way I did this was with three queries: // Categories if($page->Categories->count > 0) { foreach($page->get("Categories") as $category) { $category_array[] = $category->name; } $category_string = implode("|", $category_array); $same_categories = $pages->find("template={$page_type}, Categories={$category_string}")->filter("id!={$page->id}"); } // Tags if($page->Tags->count > 0) { foreach($page->get("Tags") as $tag) { $tag_array[] = $tag->name; } $tag_string = implode("|", $tag_array); $same_tags = $pages->find("template={$page_type}, Tags={$tag_string}")->filter("id!={$page->id}"); } // ConnectedClient if(in_array('ConnectedClient', $page->fields)) { $same_client = $pages->find("template={$page_type}, ConnectedClient={$page->ConnectedClient}")->filter("id!={$page->id}"); } if($same_categories->count > 0) $matches->import($same_categories); if($same_tags->count > 0) $matches->import($same_tags); if($same_client->count > 0) $matches->import($same_client); But for some reason, only the first "$matches" seems to stick. So to me, it would make sense to be able to structure a find query like this: $search = $pages->find(" template=post|project, [Categories=one|two|three]|[Tags=yes|no|maybe]|[ConnectedClient=1065] ")->filter("id!={$page->id}"); Does this make sense? I need to find all pages that match [Tags=yes OR no OR maybe] OR [Categories= one OR two OR three] OR [ConnectedClient=1065]. I realize it might turn into a SQL-needed scenario, but given the flexibility of Processwire, the ability to string together a query like this would be super nice. Is there a way?
  15. Hi there, I was wondering if there's a module that allows me to copy certain pages or content from one instance of Processwire to another instance? Unfortunately, I can't copy a whole instance across as there needs to be some major cleanup job performed and it won't get done in time. Otherwise, if anyone has any code samples that would be much appreciated.
  16. Hello, i have some uderdata that i need to import to mailchimp or something else. How can i create with the api an xls or cv file ? This is simple data like name surname email an newsletterstatus.
  17. Hi, I have been running a processwire based film magazine for more than 3 years now. The resources are wonderful, and the forums are full of information so much so that I did not have to ask a single question during the design process or later. I just added it in the showcase section when the site was done. http://projectorhead.in But in the last week I have been facing some real trouble and the forums dont seem to have anything related. The problem; Once in the admin section, I cannot publish any new content, pages that have some exisiting content, dont accept anything. If I wish to update module settings/ install or uninstall any new module, it does not work either. Every click on any button meant to achieve something in the admin leads to a 404 error in the front end. It started from one page but now nothing would change in the admin, it feels like it has become a hard ball of metal which would just not move. The attempts; 1. I upgraded the entire installation, thinking it was due to the outdated version. I am running the latest stable, 2.7.2, php version 5.6 2. I turned on the debug in config.php, it threw some notices and warnings, have fixed all barring one, where imagesize wants another variable, it hasnt created any issue in the past. 3. I cleared up all caches using the filemanager, removing cache files. Since the backend will not let me purge caches, I had to use the file manager. 4. I cleared the cache table from the phpmyadmin. 5. ProcessImageMinimize was throwing up errors, so I removed the calls from the template and deleted the module using file manager. 6. Saw some suggestion about the .htaccess rules, played around and nothing worked, however the .htaccess is being duly read and used by the server. I am out of options and having to stall the latest issue of our magazine, would really appreciate some quick help on what else I could try, possible solutions etc. I hope I have described the problem sufficiently, but if you need any more details, please ask. Best.
  18. hey all. i experienced a strange behaviour and wanted to ask if somebody has a solution for this. i have a page 'POIs' (points of interest) that keeps multiple 'POI' as childs. each 'POI' should be creatable via frontend through an ajax-call to the page 'create-poi'. then i have a page 'get-pois' that queries all the pages with template 'poi' and return them. Home --> POIs --> --> POI 1 [*front-end created] --> --> POI 2 [*front-end created] --> --> POI X [*back-end created] --> API --> --> Create POI --> --> Get POIs all works fine except that all the POIs created through the api only show up when 'get-pois' is called from default language. for example, POI 1 and POI 2 have been create through frontend, POI X in the admin-backend. now calling localhost/en/api/get-pois outputs all pois, calling localhost/de/api/get-pois outputs only POI X. all the pois have the required fields in both translations. can anybody of you think of a solution?
  19. Hi, I've been trying to figure this out for two days now, but I cant seem to solve the issue without core modification, which is not the good way to go for sure. I have nested hidden pages under a page called groups, and I customised the page lister module a bit extending the ProcessUser class (called processOffers) I have a custom JSTree module to select from these groups, so multiple selection is possible. My problem is,when click on the filters, and select groups in the lister module, I can see only the first level (which is a parent directory), but not the nested ones what I need. I tried to catch the ajax call in my processOffers module, but seems like the control never reach my module, instead it goes to the InputfieldSelector::renderOpval straight, so I have no way to override it or write a hook or anything. One thing I noticed is if I copy the ajax query and paste it into my browser url, it invokes my processOffers class, but it doesn't do it if I do it via ajax! ( ...backend/offers/?InputfieldSelector=opval&field=groups&type=&name=filters) > Update: Okay, so this one is because of the X-Requested-With:XMLHttpRequest header. How could I list the nested pages as a flat list or how could I interact with this ajax call to override the result?
  20. I am using @Damienov's tweaked bootstrap menu for a project, but ran into a snag. I have a few pages that I dont want to display in the header navigation (but will be used in the footer, another hurtle). Does anyone have any advice on how to achieve this?
  21. Hello, Getting random pages with $oldPosts = wire('pages')->find('template=post, shown=1, limit=100')->findRandom(16); works fairly good. About 500ms But without the limit=100 it takes more than 6 seconds. There are only 60 pages with template post but it will be thousands when the app is live. Is there a more efficient way of getting random pages?
  22. Hello, I am using a media manager based on pages (1 file = 1 page). I would like to move the dummy file page "Dateityp" to the page folder "Jo!". In PW, I can move this file outside the current folder and into a folder, when there is at least one other file in it. I would like to have the feature of dragging a page onto another page (because my media manager does not really have folders, they are all pages) to be inside this dragged-on page. I think PW does not implement this because of some possible issues if the "Family" for these templates/pages isn't configured right (e.g. does not allow children). A ugly workaround is going to settings of this page and changing the "Parent". This works, but is not nice UX... I hope anyone can help me with that. Is this a bug or a feature?
  23. I thought I had this, but I guess my understanding of get/find for pages is a bit lacking (or perhaps nonexistent). I am trying to switch the stylesheet based on the URL using a simple if/else statement, but what I wrote doesn't seem to be doing the job. I currently just have two pages (that each need two different background images), but they share the same head.inc file. I wrote: <?php // Switch stylsheets based on site $styleSwitcher = $pages->get('/url-one/'); if($styleSwitcher){ echo "<link rel='stylesheet' href='{$config->urls->templates}css/one.css' />"; } else{ echo "<link rel='stylesheet' href='{$config->urls->templates}css/two.css' />"; } ?> I assume I messed up my "get" as both pages are still loading one.css
  24. Is it possible to delete and edit pages from the frontend? Because I know its possible to create pages via the API from the Frontend. Even when the user role only has view permission and not edit permissons. creating pages: https://processwire.com/talk/topic/352-creating-pages-via-api/ https://processwire.com/talk/topic/3105-create-pages-with-file-upload-field-via-api/
  25. Hello Processwire Community Lets say I have a Multi-User-System where I can create/update as "normal" user new events, dates, multimediapages, imagepages etc.... As Admin I can create organisers(owners) and assign them respectively to specific users. Module for creating/updating pages: Fredi - Friendly Frontend Editor Scenario: Add new Imagepage under Multimedia > Images Important Fields select_organiser(FieldtypePage)(btw. this field is assigned to the user template) PHP-Selector for "select_organiser" if(wire('user')->isSuperuser()){ return $pages->find("template=organiser"); } else{ return $pages->find("template=organiser, id=".wire('user')->select_organiser); } Templates image-index(is assigned to Image-Page) -> Fields: only title - > images-index.php Only show the image pages which has the same organiser like the current user. <?php $out .="<h3>$title verwalten</h3> <div class='span11'> <div class='btn-pos-1 add'>" .$fredi->setText("<i class='fa fa-plus'></i> Bild erfassen")->hideTabs("children|delete|settings")->addPage("image", "title|select_organiser", $pages->get(1153)). "</div> <table id='example' class='row-border' cellspacing='0' width='100%'> <thead> <tr> <th>ID</th> <th>Bildname</th> <th>Bild</th> <th>Beschreibung</th> <th>Veranstalter</th> <th>aktualisiert</th> <th></th> <th></th> </tr> </thead> <tbody>"; if($user->isSuperuser()){ $images = $pages->find("template=image"); } else{ $images = $pages->find("template=image, select_organiser=$user->select_organiser"); } foreach ($images as $i_item) { if($i_item->image){ $thumb = $i_item->image->size(50, 50); } $out .= "<tr> <td>{$i_item->id}</td> <td>{$i_item->title}</td> <td><a class='large_img' href='{$i_item->image->url}' ><img src='{$thumb->url}' /></a></td> <td>{$i_item->image_body}</td> <td>{$i_item->select_organiser->title}</td> <td>".date('Y-m-d', $i_item->modified)."</td> <td><a href='{$i_item->url}'><i class='fa fa-eye'></i></td> <td>".$fredi->setText("<i class='fa fa-pencil'></i>")->renderAll($i_item)."</td> </tr>"; } $out .= " </tbody> </table> </div>"; images(is assinged to children-items of Image-Page) -> Fields: title, image, image_body, select_organiser -> images.php At the beginnnig of the template it checks if the select_organiser of the current user is the same as the select_organiser of the current image page. <?php if($user->select_organiser == $page->select_organiser || $user->isSuperuser()){ $out .= "<h3>{$page->parent->title} Details</h3> <div class='span8'> <table class='detail-view table table-striped table-condensed'>"; $out .= "<tr class='odd'><th>ID</th><td>{$page->id}</td></tr>"; //get all fields: $all_fields = $page->fields; foreach($all_fields as $field){ if($field->type == "FieldtypeImage"){ $out .= "<tr class='odd'><th>{$field->label}</th><td>{$page->get($field->name)->url}</td></tr>"; } else if($field->type == "FieldtypePage"){ $out .= "<tr class='odd'><th>{$field->label}</th><td>{$page->get($field->name)->title}</td></tr>"; } else{ $out .= "<tr class='odd'><th>{$field->label}</th><td>{$page->get($field->name)}</td></tr>"; } } $out .= "<tr class='odd'><th>erstellt</th><td>".date("Y-m-d H:i:s", $page->created)."</td></tr> <tr class='even'><th>aktualisiert</th><td>".date("Y-m-d H:i:s", $page->modified)."</td></tr> </table> </div> <div class='span3'> <div id='sidebar'> <ul class='well nav nav-list' id='yw1'> <li class='nav-header nav-header'>Aktionen</li> <li><a href='{$page->parent->url}'><i class='fa fa-list'></i> Bilder auflisten</a></li> <li>".$fredi->setText("<i class='fa fa-pencil'></i> Bild bearbeiten")->renderAll($page)."</li> </ul> <br /> </div> </div>"; } else{ $session->redirect($error404->url); } The Problem of this System is that the user still can access to image-pages in the backend that dont have the same organiser. Its only view protected. So finally my Question: Can i specifiy a PHP-Selector for the editable pages for the Page Edit Per User Module. Like: return $pages->find("template=images, id=".wire('user')->select_organiser); So that the user can edit the image - pages which has the same organiser like him? Pagetree Structure and some screenshots of the interfaces for visualization: Pagetree Structure: Home(Login-Page) - Dashboard(Intro-Page) -- Events(visible for superuser and user with role: company) -- Agenda/Dates(visible for superuser and user with role: company) -- Multimedia(visible for superuser and user with role: company) --- Images(template: image-index) ---- example-img.jpg(template: image) ... --- Videos -- Profile(visible for superuser and user with role: company) -- Organisers(Only visible for Superuser) --- Organiser-Profiles ---- XYZ AG ... --- Adresses --- Locations -- Settings(Only visible for Superuser) -- Logout Image - Overview Page Image - Detail Page PS: Sorry for the long post
×
×
  • Create New...