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. Hi I am looking into ProcessWire to build an application. I am used to building applications that have db models separated out, which is nice and organized for building the application. I would also want to separate out a lot of the logic for the application(more in a Model View/Presenter fashion) and have seen some people are doing MVC with ProcessWire. But I wonder if I use pages, would this be similar to having models? I read somewhere that Users are pages in processwire, and user attributes can be fields of these pages. So maybe pages are one of the magic ingredients in PW? Can/should I do the same for other db models in the application(use pages as the models), or would I better be served by integrating an MVCmodule into PW, or using Laravel with PW? It's starting to seem like PW is a very different type of framework and can do all the MVC stuff, but in a slightly different paradigm, and that Pages are like the model, and Templates are the View/Presenter/Controller. And you could separate out the controller if you wanted to create some classes and implement some routing if you wanted.
  2. Wondering if anyone has made a way of displaying filed content of pages on the page list (or another admin page / sidebar). For example: an indication of new page comments displayed on the page list. a count of the number of photos for each page that hows photos. Mock up:
  3. Greetings I'm new to PW, and think it's fantastic! Never, ever, have I seen such an amazing CMF! Anyways, to my question: I had set some Hanna Code to render a list of page suggestions on the http404 page, which works perfectly. The problem, however, comes in when I use repeaters, which are page instances. The page suggestion renderer has the following: $suggestions = $pages->find('name|title|summary|body%='.$request); I have a page that is named services-industries, and repeaters with the word services in the name. As such, repeaters appear in the suggestion results-list if applicable to the search. How can I exclude/remove those?
  4. Hi! Is there any way when a parents children are sorted by the user to enable a new child to be listed at the top of the list? my site has loads of child pages so it's cumbersome to add a new child and move it when it is listed at the end of the list each time, instead of the top (the same way they delivered on the site reading from the top of the list). Cheers,
  5. I'm not able to get my array list. I have a menu template and I'm grabbing it, but it won't let me go inside it I get this error Warning: Invalid argument supplied for foreach() in /x/site/templates/includes/header.inc on line 61 $items = $pages->find('template=menu, title=Toolbar Menu, include=all'); //THIS SHOULD WORK foreach ($items->menu_item as $item) { $output .= '<li><a href="' . $item->link . '"'; if ($item->open_in_new_window) $output .= ' target="_blank"'; $output .= '>' . $item->title . '</a></li>'; } I'm attaching a screenshot of a selector test
  6. Hello, I'm trying to create some pages programatically, nearly 2000. they have many fields and the server crashes before complete saving them. There's a way to save this pages by small amounts? Thanks!
  7. I am developing a little app for my university to pass it, the problem is to count some number, i used field page for select stuff in my Template AddProject i have 4 fields beside name and title template AddProject with field ------- Field "SelectUSer" (user1, user2, user3) this field / page / Single page (Page) or boolean false when none selected ------- Field "SelectStatus" (Active, Inactive) this field / page / Single page (Page) or boolean false when none selected ------- Field "SelectProf" (Name, Name2, Name3) this field / page / Single page (Page) or boolean false when none selected ------- Field "SelectSource" (10,20,30,40,50,60,70,80,90,100) this Field is Select not page and i have a page when i list projects ListProject ----------Project 1 ------------Field "SelectUSer" (user1) ------------Field "SelectStatus" (Active) ------------Field "SelectProf" (Name) ------------Field "SelectSource" (20) ----------Project 2 ------------Field "SelectUSer" (user2) ------------Field "SelectStatus" (Active) ------------Field "SelectProf" (Name2) ------------Field "SelectSource" (50) ----------Project 3 ------------Field "SelectUSer" (user3) ------------Field "SelectStatus" (Active) ------------Field "SelectProf" (Name3) ------------Field "SelectSource" (80) i want to query Project 1 | User1 | Active | Name | 20 Project 2 | User2 | Active | Name2 | 50 Project 3 | User3 | Active | Name3 | 80 also query for user to grab field related to user and page user1 | Active | and Field SelectSource to get number from pages which have selected user1 or other user
  8. I'm a beginner. I have a question about how data is stored in PW. 1. If I have the field "questions", and I want to store 10 seperate questions, are they stored as 10 individual pages, that are linked to the template, which is linked to the field "questions"? If not, how are they stored. 2. If they are stored as pages, is there some kind of limitations on the number of pages... example: pages > 1,000,000 Is there a limitation on concurrent outside-users adding pages? example 500 pages per minute? Thanks, just trying to understand... i've learned some from the basic tutorial, but still questions persist.
  9. Hi i need to sort pages for upcomming games. so i have this code <?php $Match = $pages->find('parent=1022, sort=date'); $tab = ""; $button = ""; $i = 0; foreach ($Match as $match ) { $date = date("d F", $match->getUnformatted("date")); $time = date("h:i", $match->getUnformatted("date")); $count = count($match); $selectVal = ''; if ($match->transmition == '1') $selectVal = 'tak'; else $selectVal = 'nie'; if ($i == 0) { $button .= "<a class='active {$i}' href='#tab_{$match->id}'>Następny mecz</a>"; $tab .= "<div id='tab_{$match->id}' class='tab active'>"; }else{ $button .= "<a class='{$i}' href='#tab_{$match->id}'>Poprzedni mecz</a>"; $tab .= "<div id='tab_{$match->id}' class='tab'>"; } if ($match->logo1) $logo1 = $match->logo1->size(77,77)->url; else $logo1 =''; if ($match->logo2) $logo2 = $match->logo2->size(77,77)->url; else $logo2 =''; if($date && $time) $tab .= "<dl><dt>Kiedy?</dt><dd>{$date} {$time}</dd></dl>"; if($match->team_name2) $tab .= "<dl class='teamname'><dt>Z kim gramy?</dt><dd>{$match->team_name2}</dd></dl>"; if($match->text_input) $tab .= "<dl><dt>Gdzie?</dt><dd>{$match->text_input}</dd></dl>"; if($match->text_input2) $tab .= "<dl><dt>Jaki typ rozgrywki?</dt><dd>{$match->text_input2}</dd></dl>"; if($match->text_input3) $tab .= "<dl><dt>Jakie bilety?</dt><dd>{$match->text_input3}</dd></dl>"; if ($selectVal) $tab .= "<dl><dt>Czy będzie transmisja?</dt><dd>{$selectVal}</dd></dl>"; if ($logo1 && $logo2) { $tab .= "<div class='clear'></div>"; $tab .= "<div class='logos clearfix'>"; $tab .= "<div class='logo1'><img src='{$logo1}' alt='' /></div>"; $tab .= "<div class='vs'>VS</div><div class='logo2'><img src='{$logo2}' alt='' /></div>"; $tab .= "</div>"; } $tab .= "</div>"; $i++; if($i > 1) break; } ?> <section class="next-match"> <div class="container"> <div class="span4"> <div class="tabs clearfix"> <?php echo $button; ?> </div> <div class="tab-wrap"> <?php echo $tab; ?> </div> </div> </div> </section> now i need first $tab to be the closest next date from today's date, in the second $tab i need to display the last one played from today's date. The first one is working fine showing exacly what i need, just cant figure out how to dispaly the last one played. Any idea how can i achive this ? Regards Paweł
  10. Having difficulty finding this question previously asked, but here goes: I'm following Macrura's tutorial for creating custom menus (where the menus aren't a reflection of the site's page hierarchy). As a first step, I've created a page called Menus with children that use a template with a Pages field type. This is set to use PageListSelect as the input type, which lets me pick a specific page in the hierarchy from any parent tree. Is it possible to exclude certain pages from being selectable in the tree? It notes that I can't use PageListSelect and restrict by page template, so how else might I go about it? These pages are already set to be "Hidden: Excluded from lists and searches" so I'm not sure why they still appear in the list of selectable pages?
  11. All: If you saw some of my recent postings where I was trying to solve the problem of running a query as a field, I have solved it. I started with Hanna text, but that didn't quite get me all the way. Then I tried just a Concat field, and that didn't get me all the way. I modified the Concat fieldtype for my solution. I had a need to dynamically pull Pages that were cross-referenced back: Product as a Page Photo Pages with a multi-Page Select field that referenced Product (A photo could represent 1+ Products) I wanted a ->photos field from Product that was updated dynamically according to what Photo entries were currently in place, and I didn't want copy/pasted code, and I wanted the selectors to be easily modifiable from the admin screens. Usage is faily simple: 1: Install as a normal module 2: Create a field as a PagesSelectorQuery type 3: On the field details, enter your selector string, ie: template=my_template,select_page_field=$page 4: Add your field to whichever templates. 5: Access the PageArray results like you would any other $page->field I hope you find it useful, at the very least as an exercise in my madness. Thanks again for all the help this community has provided. EDIT: Added to GitHub: https://github.com/alevinetx/processwire-modules/blob/master/FieldtypePagesSelectorQuery.module And Module's page: http://modules.processwire.com/modules/fieldtype-pages-selector-query/ FieldtypePagesSelectorQuery.module
  12. Just testing process wire 2.3 I moved a few recently created pages, yet I can't empty the trash. I get this error, telling me that this SQL table is missing: field_fieldset_meta_end' doesn't exist I can see the table on phpMyAdmin. Thanks in advance.
  13. Hello everyone, I'm currently trying to find the best way to solve a problem and I'm not really sure, whether there's an easy solution. Consider this example: 1. There is a template for "author", "article" and "tag". 2. The "article" template has a) a pages field for authors on or multiple authors and b) a pages field for on or mutilple authors tags 3. On the "authors" page I want to display a list of all tags, for which this author has articles. The naive approach would be to just get ALL tags, iterate through them, check if there's a page with the given author and this tag and if yes, add them to the list of display tags. Something like this: $authorTags = new PageArray(); $allTags = $pages->find('template=tag'); foreach ($allTags as $tag) { if($pages->count("template=article, tags=$tag")) { $authorTags->add($tag); } } While this works great, there's obviously a big performance problem: it doesn't scale since each additional tag results in one additional query. The cache will have to be cleared on changes of each article, which could happen pretty often, so this is not a solution. My second approach was to have an additonal field for tag in the "author" template and write a module that hooks into page save of "article" pages, checking for changes in the tags field and replicating them in the given author's pages. In the "author" template you can then just display your tags as a "native" field, which shoud be simple and performant. While I think, that this will probably the best and most clean solution, it will also be a lot of work, so I was wondering whether anyone of you maybe knows a) an easier (while still performant) way to archieve this, or b) a finished module that already solves this problem or is at least a good starting point to solve it. Thanks a lot for your answers already, Marc
  14. I know there are a lot of category-topics on this forum already, but I can't find a solution for my problem. I got the following page-tree: Downloads - Download 1 - Download 2 - Categories -- Category 1 -- Category 2 --- Subcategory 1 ---- Deeper Subcategory -- Category 3 So categories can be really deep. Each download is assigned to one category only. And I would like to output it in my template like this: Category 1 - Download 1 Category 2 - Subcategory 1 -- Deeper Subcategory --- Download 2 But I can't find a good selection to do so.
  15. Hello I wonder how I should do if I want give to my client the permission to delete some specific pages but prohibit others. In my case, the site where I am working on there are "works" pages, that I'd like the client be able to edit/delete but the rest of pages, he can just edit, not delete them. In other word, I'd like my client can be able to delete to pages with template "work" and no other pages with other templates. This should be my sitemap: Home (client can just edit) Works (just edit) - Work 1 (edit and delete) - Work 2 (edit and delete) ... - Work N (edit and delete) Store (just edit) Contact (just edit) Any suggestion? Thanks
  16. Hi! I´m really liking ProcessWire, even though it´s a little intimidating to a complete PHP noob like me. The basics are pretty easy understand, but one function I still lack is the option to sort pages by custom fields. I looked at Ryans Scryscraper Site Profile to try to figure out how he did it for about 5 minutes before my brain exploded. I´ve also tried to search the forums without success. So if this is something that some of you PHP gurus could help me with that would be awesome. Here´s my question. Lets say I have a photos page with lots of photo pages in it which include custom fields such as resolution, camera, size etc.. How would i go about to list them by these fields? For example like this: select -option(Camera model from A-Z) -option(Camera model from Z-A) select -option(Highest resolution) -option(Lowest resolution) select -option(Highest size) -option(Lowest size) [Find] Thank you. /Jan Londén Edit: Here´s the final code. Remember this is an ugly copy/paste version from a non PHP programmer. Use at your own risk, etc.. If anyone wants to improve, make this more elegant, please do. Huge thanks to adrian who helped a lot. <?php /** * Books template * */ include("./head.inc"); $selector = ''; // For the keyword search input. Searches both title and body. if($input->get->keywords) { $value = $sanitizer->selectorValue($input->get->keywords); $selector .= "title|body%=$value, "; $summary["keywords"] = $sanitizer->entities($value); $input->whitelist('keywords', $value); } // For the book publisher select tag. Sorts alphabetically from A to Z. if($input->get->book_publisher == 'desc') { $value = $sanitizer->selectorValue($input->get->book_publisher); $selector .= "sort=book_publisher,"; $summary["book_publisher"] = $sanitizer->entities($value); $input->whitelist('book_publisher', $value); } // From Z to A. elseif($input->get->book_genre == 'asc') { $value = $sanitizer->selectorValue($input->get->book_genre); $selector .= "sort=-book_genre,"; $summary["book_genre"] = $sanitizer->entities($value); $input->whitelist('book_genre', $value); } // For the book chapters select tag. Sorts numerically from highest to lowest number of pages. if($input->get->book_chapters == 'desc') { $value = $sanitizer->selectorValue($input->get->book_chapters); $selector .= "sort=book_chapters,"; $summary["book_chapters"] = $sanitizer->entities($value); $input->whitelist('book_chapters', $value); } // From lowest to highest. elseif($input->get->book_chapters == 'asc') { $value = $sanitizer->selectorValue($input->get->book_chapters); $selector .= "sort=-book_chapters,"; $summary["book_chapters"] = $sanitizer->entities($value); $input->whitelist('book_chapters', $value); } // For the book pages select tag. Sorts numerically from highest to lowest number of pages. if($input->get->book_pages == 'desc') { $value = $sanitizer->selectorValue($input->get->book_pages); $selector .= "sort=book_pages,"; $summary["book_pages"] = $sanitizer->entities($value); $input->whitelist('book_pages', $value); } // From lowest to highest. elseif($input->get->book_pages == 'asc') { $value = $sanitizer->selectorValue($input->get->book_pages); $selector .= "sort=-book_pages,"; $summary["book_pages"] = $sanitizer->entities($value); $input->whitelist('book_pages', $value); } ?> <form id="book_search" method="get" action="<?php echo $config->urls->root?>books/"> <h3>Browse books</h3> <p> <label for="search_keywords">Search</label> <input type="text" name="keywords" id="search_keywords" value="<?php if($input->whitelist->keywords) echo $sanitizer->entities($input->whitelist->keywords); ?>" /> </p> <p> <label for="book_publisher">Publisher</label> <select name="book_publisher" id="book_publisher"> <option value="">Any</option> <option value="desc"<?php if ($input->get->book_publisher == 'desc') { echo ' selected="selected"'; } ?>>Alphabetically A-Z</option> <option value="asc"<?php if ($input->get->book_publisher == 'asc') { echo ' selected="selected"'; } ?>>Alphabetically Z-A</option> </select> </p> <p> <label for="book_chapters">Number of chapters</label> <select name="book_chapters" id="book_chapters"> <option value="">Any</option> <option value="desc"<?php if ($input->get->book_chapters == 'desc') { echo ' selected="selected"'; } ?>>Highest to lowest</option> <option value="asc"<?php if ($input->get->book_chapters == 'asc') { echo ' selected="selected"'; } ?>>Lowest to highest</option> </select> </p> <p> <label for="book_pages">Number of pages</label> <select name="book_pages" id="book_pages"> <option value="">Any</option> <option value="desc"<?php if ($input->get->book_pages == 'desc') { echo ' selected="selected"'; } ?>>Highest to low</option> <option value="asc"<?php if ($input->get->book_pages == 'asc') { echo ' selected="selected"'; } ?>>Lowest to high</option> </select> </p> <p> <input type="submit" id="book_submit" name="submit" value="Find" /> </p> </form> <?php $books = $page->children($selector); ?> <?php if (count($books)) : ?> <ul> <?php foreach($books as $book) : ?> <li> <p> <a href="<?=$book->url?>"><?=$book->title?></a><br> Publisher: <?=$book->book_publisher?><br> Number of chapters: <?=$book->book_chapters?><br> Number of pages: <?=$book->book_pages?> </p> </li> <?php endforeach ?> </ul> <?php else : ?> <p>No books were found.</p> <?php endif ?> <?php include("./foot.inc"); You might need to change desc/asc values to get them working the way you want.
  17. Hi, I'm just setting up a new site using the blog profile. I've used it before for a site that was purely a blog so I'm familiar with all the basic stuff to do with setting it up and all that. The issue I'm having is that with this site the blog is just a section of the site. So i need the front page to be just a plain basic page (with latest posts/comments in the sidebar, but no posts on the page), and the site will have a few other pages, and then the blog will be accessible via the navigation. I have already installed the blog profile and have created all the pages I need, including the page I want to use as a the homepage, how do I go about setting this up? thanks
  18. Hello As I said in my first post, I come from Textpattern. It has a great feature I not sure if PW can do it. What I want is select several pages and change theirs status at the same time. For example, I select five pages (articles in TXP) through checkboxes and then I chose the status to hidden (unpublish) or published. That way, we'd save a lot of work / time doing one by one. I mean do it in the admin side. My questions is: Is it possible to do it in PW or is there some module for this purpose? Thanks Fernando
  19. Based on the structure below, "employee", "department" and "year" are simply place holder "pages". Each have been assigned a blank template and contain only a title field which is required. They serve no other purpose. The issue I was seeing is that I could access these pages in the url directly. For example, root/location1/employee/ would simply display a blank page. This is undesirable for me as it made me fell empty and marking the page as hidden in the back-end did not resolve the issue. So I saw the option unpublished in the back-end and it works perfectly. I then found Ryan's post here which explains a lot but this example I think deserves its own topic. Would my handling of this be considered advisable or would something else be a better solution, like a 301? I noted that marking a page hidden excludes it from the find() method, but I simply grabbed the children by their templates. Location 1 - Employee -- John Doe --Jane Doe - Department -- Confused Department --Even More Confused -Year -- 2013 -- 2014
  20. Hi everyone. I'm from Argentina so my appologies for my English (I'm begginer student). As I've read in other post, I also came from Textpattern world. Other fantastic CMS that gave me many satisfactions. I'm looking forward for the next version TXP5, meanwhile I'd like try on PW because many interesting things have catched my attention. I'm graphic designer with some HTML / CSS knowledge but almost or nothing of PHP. I think I've understood how PS works, but I'm stucked in something that should be very simple. So here there is my first doubt. I want to put a list of pages are using a specify template with my own markup. I guess I should use a similar code like this: $skyscrapers = $pages->find("template=skyscraper"); foreach($skyscrapers as $s) echo "<li><a href='{$s->url}'>{$s->title}</a></li>"; But, I can't understand what is $s for or how I could limit the number of pages (amongst other things) I want to show. So, I'll be grateful if someone can clear me up. I have a lot of questions but I'll try to find out by myself, if not, probably I'll go back for here On other hand, I haven't seen a forum in Spanish, so I'd like users who speak it create one. Also, I would want to offer my help for translating PW to my language and this way Spanish community goes raising such as it happens on TXP forums. Best regards and thanks in advance. Fernando
  21. First time using ProcessWire. As a developer I've been impressed so far. Having trouble sorting a series of pages that are children of a top level page. I've tried sorting them from the Pages page (/admin/page/) as well as from the Children tab of the parent page. I watch the network traffic in Chrome and see that when I move one of the pages there is a POST to /admin/page/sort/ with form data that includes sort= . But when I reload either admin page, or reload the site page that lists them, the order is unchanged. What am I missing here? Thanks!
  22. Hello, I'm trying to write an if statement which queries whether a given page - identified by that page's title - has any children. I've tried various things, the most hopeful being: $info = $pages->find("title=previous caption winners")->children; if ( $info >= 1 ) { //do stuff }; but to no avail. This seems like a fairly simple task but I've had no success despite my efforts to find answers here and elsewhere. Any help would be greatly appreciated. All thanks, ben
  23. I m updating an old install of PW onto a new server with latest version of PW. Have changed alot of stuff but am still looking to retain some pages: e.g. all the news children pages. Been trying to use the import from CSV module for this by exporting using mySQL but im not really sure what im doing and I've managed to get an CSV with the page titles but not any content - Is there an easy way to do this? Or does any one have a module or mySQL script to select all the pages with child of id=x in a form they can be imported? Thanks!
  24. I am trying to output a list of link to children pages that display the child's title and the first image on the child page. I am doing that ok but I do not know how to return a thumbnail size image rather than full size. My image field is called "selectedimages". This is what I have: <?php if ($page->children) { foreach($page->children as $selectedthumbs) { $firstimage = $selectedthumbs->selectedimages->first(); echo "<a href='{$selectedthumbs->url}'><img src='{$firstimage->url}' alt='{$firstimage->description}'></a>"; }} ?>
  25. Hi, so I know you can create templates with many and very versatile field types but is there also a way to add field on a page per page basis without creating various page templates before? Let's say I want to add a page with: title body some great other field type body yet another field type (and then on the bottom a button which lets me add more fields) [ + add another field type ] - [ body ] - [ some great other field type ] - [ yet another field type ] and also be able to control the sorting of those. It's kind of like the template creation but within the page creation/editing Is there something I am not getting? Is there a way? thanks, Christian
×
×
  • Create New...