Jump to content

Search the Community

Showing results for tags 'pages'.



More search options

  • 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
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Categories

There are no results to display.


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

Found 93 results

  1. 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
  2. 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>"; }} ?>
  3. Hello, Somehow I can't seem to get a new user role to publish new pages -- only create and save unpublished. I created a new role called "editor" with view, edit, delete, and move permissions. I also allowed access management on the appropriate template. Still nothing. What am I missing? I'm using PW 2.2. Knowing how this goes, I'll probably figure this out in a second or two...! Tempting fate, -e.
  4. 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.
  5. 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
  6. 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
  7. 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.
  8. 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
  9. 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.
  10. 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
  11. 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!
  12. 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!
  13. 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
  14. Hello Everyone, I'm working on a module that pulls a JSON list of videos of a server and creates a page for each video. These videos come with several tags and I would like to include them. My plan is as follows: - Create a page for the video with the neccessary data - Seperate the tags for each video - Check for each tag if a page with that title exists under /tags/ - if not, create it - add that page to the "tags" field of the video page. It's the last part that I can't figure out. Could you explain to me how to add a page to a field in an existing page via the API? Thanks, thomas
  15. Hi everyone, I am sorry if this question is somewhere in the forums already, but I've passed my last hour searching for it's answer and I couldn't find it. The problem is the following: I have a Checkbox Page Field inside a Repeater Field. Basically, what I need is to get the title of the selected page(s) in that item. I've tried the following: <?php foreach($page->banners as $banner) { // cycles through repeater items var_dump($page->pagefield->title); What can I do?
  16. I have a serious problem with understanding the process field and how the process catches actions like "add" or "edit" from the url path (e.g. …languages/add/, languages/edit?id=xy) to execute the right method (executeAdd() etc.). I’m currently working on a more comfortable solution for select fields with preset options. For each select field created through setup/field/ a child page is created below having the name of the field. The child page’s template has a process field set to call a process extending ProcessPageType like it's the case with setup/languages/. Each option of the select field will be stored as an own page with title and a value field as a child of the select field page. Now I want to act the whole thing like the language admin interface. I got the list rendering working on setup/field/select_field_name/ but I get a 'Page Not Found' on calling setup/field/select_field_name/add/ as well on calling edit?id=xy. Any hints? Thanks in advance.
  17. Good evening, I am trying to build a system that relates two pages (using a Page field) but assures that the related page also relates to the current page we're editing. Like if we were talking about synonyms. Does anyone have a clue on how to achieve this? Thanks!
  18. When I for example generate a list of articles, I get my pageArray through the API within another page’s template, iterate through it and call the render method for output. Works great. But what to do if I wanted to make the template of these articles behave in a certain manner depending on the the context (the current page’s template) the render method is called from? Is there a way to access the vars existing within the current page’s template or even the current page’s field values on rendering from the articles’ template? To check “Am I rendered within/from another page’s template?” and “Is the var $xy or the field ‘ab’ set to ‘brabra’ in the other page I’m rendered in/from?”
×
×
  • Create New...