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. 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
  2. Hi, when moving a page in the page tree via drag'n'drop, it was not possible (for me) to move it one level down beneath another page. This only works, when the destination page already has a child page. Is there a trick to do drag and drop a page one level beneath another page, even if this page hasn't already got a child page? I tried this in Firefox and Chrome. Thanks in advance.
  3. 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
  4. 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,
  5. 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?
  6. 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
  7. 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.
  8. 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!
  9. 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
  10. 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.
  11. 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-->
  12. 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
  13. I have a page field on my home template with output set to multiple pages (PageArray). I can echo its value, 1111|2222, or foreach $nav as $p echo $p, 11112222. But when I do this that I need to, it doesn't work: foreach ($mainnav as $p) { if($page->rootParent->id == $p->id) $current = 'style="background: #fff;"'; else $current = ''; echo "<a href='{$pages->get($p)->url}' $current class='{$pages->get($p)->name}'>" . strToUpper($pages->get($p)->name) . "</a>"; } I get: I've tried the conditional in the code with one and three = signs.
  14. Hi, well, here's something I just don't understand and didn't find an explanation in the reference for. I've got a number of pages: HomeAuthorTomas Tranströmer José Saramago Kenzaburō Ōe ... Nobel prize2012 2011 ... I created a field "author", type Page, which contains all these 3rd level pages (Tomas Tranströmer, José Saramago, Kenzaburō Ōe, ...). In the template used i.e. for /nobel-prize/2011, the "author" field is populated and contains the page ("Tomas Tranströmer"). Now I would like to create an output: $content .= $pages->get($page->author)->title; Confusingly, the output is Home although the output for $content .= $page->author; is 1026 and the output for $content .= $pages->get(1026)->title; is the desired Tomas Tranströmer So I seem to create a problem with using $pages and $page in the same line, but what is it exactly and how will I fix it? Thanks a lot!
  15. 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
  16. Resources (Ryan's own): ImportPagesCSV FieldtypeMapMarker So I edit the accepted $fieldtypes on :76: /** * List of Fieldtypes that we support importing to * */ protected $fieldtypes = array( 'FieldtypePageTitle', 'FieldtypeText', 'FieldtypeTextarea', 'FieldtypeInteger', 'FieldtypeFloat', 'FieldtypeEmail', 'FieldtypeURL', 'FieldtypeCheckbox', 'FieldtypeFile', 'FieldtypePage', 'FieldtypeMapMarker', 'FieldtypePassword', 'FieldtypeRepeater' ); Page, MapMarker, Password and Repeater were added by me. Then alter importPageValue: /** * Assign a value to a page field * */ protected function importPageValue(Page $page, $name, $value) { $field = $this->fields->get($name); if($field->type instanceof FieldtypeFile) { $value = trim($value); // split delimeted data to an array $value = preg_split('/[\r\n\t|]+/', $value); if($field->maxFiles == 1) $value = array_shift($value); $data = $page->ImportPagesCSVData; $data[$name] = $value; $page->ImportPagesCSVData = $data; } elseif($field->type instanceof FieldtypePage) { $value = trim($value); if(wire("pages")->find("$name=$value")) $page->set($name, $value); } elseif($field->type instanceof FieldtypeMapMarker) { $value = trim($value); $page->set($name->address, $value); } elseif($field->type instanceof FieldtypeRepeater) { // } else { $page->set($name, $value); if($name == 'title') $page->name = $this->sanitizer->pageName($value, 2); // Sanitizer::translate elseif($name == 'fullname') { $page->name = $this->sanitizer->pageName($value, true); } } } Page import works with ID values, which was trivial to incorporate; passwords too. MapMarker and Repeater as you might guess do not. How can I save the map->address value? Hopefully it will update the corresponding map fields too but one thing at a time. As for the repeaters... LostKobrakai tipped me off to foreach($page->engines as $e) { foreach($e->fields as $field) { echo $field; echo $e->get($field); } } which works for their names and values, but in this function you're passed the field, and something like foreach($page->$field as $e) { foreach($e->fields as $field) { echo $field; echo $e->get($field); } } doesn't work... and what it would need to do inside anyway is check for a subfield whose name is equal to the column header (choose the repeater field itself e.g., engines in the select per repeater subfield value, e.g., engine_fueltype), then explode that cell value by pipes ('|'), and for each subvalue, populate the repeater#->subvalue... but before all that I need to be able to iterate through the subfields from the field in this function. Anyone have any ideas?
  17. How can I programatically Save() to a Page Type field that contain multiple pages (PageArray)? This attempt fails with no error message, nothing is saved: $p = $pages->get(1234); $p->of(false); $p->foo = 4321; # Page Type field, I am trying to update the ID. // $p->foo = "bar"; // $p->foo->id = 4321; # Results in "Fatal error: Exception: Item 'id' set to PageArray is not an allowed type". $p->save(); Observation: It's hard to search documentation and forum entries for this topic because the keywords Page, Type and Save are frequently used in different contexts. I guess the most logical place to find information would be on 1) the "API Variable > $page" page - and/or, the "API Variable > FieldTypes" page. My request is that the documentation at some point will cover how to programatically CRUD each core field type (Checkbox, Datetime, Email, FieldsetOpen, FieldsetTabOpen, File, Float, Image, Integer, Page, Password, (Repeater), Text, Textarea, URL). Merry Christmas and thanks. Related: Create/Update a page programmatically
  18. Not sure if this is by design - or if I'm perhaps missing the obvious. I'm just getting my feet wet with pw (2.5.3) and have created a partial sitemap template (nothing fancy, just recursing through a partial tree). When I added a page field to my sitemap template, selected a page and tried to save, I got a memory limit exceeded error. The problem appeared only when the page picked in the page field was the same as the one being edited. public function resetTrackChanges($trackChanges = true) { parent::resetTrackChanges($trackChanges); foreach($this->data as $key => $value) { if(is_object($value) && $value instanceof Wire) $value->resetTrackChanges($trackChanges); } return $this; } Looking at this method, I guess it's easy to see that this will run in an endless loop if one of the properties of $page is once again $page. As a quick fix, this could be cured by comparing $this and $value in the conditional, but there'd still be a possibility of building circular patterns that have the same problem. Not sure how to go about that. Edit: Of course, InputfieldPage prevents me from even assigning the same page here at all (my fault). Still, the check in Inputfieldpage::isValidPage appears to happen too late.
  19. in my page i store value of page by using page type field, field name is: page_side_menu when i call that field in template using $pid=$page->page_side_menu; echo $pid; i can see the page number but when i use bellow code i return me page title of home page not selected page. $pid=$page->page_side_menu; $paged=$pages->get($pid); echo $paged->title; why i am getting title of home page not page with id in $pid. Thanks
  20. i've searched this topic via google but didn't found anything... question is simple in a pagefield i get some entries (autocomplete, or multipageselect...) - is it possible to get a edit link on these pages link in the admin edit templatefield lists? i know there is the id given and with that i could code some js to get a link from that....but first ask if there was a proper methode or solution ready to use? a little screen for example: regards mr-fan
  21. Hi. I wonder if is there possibility to limit page children to specific template. I know that it can be done in template settings. But I think it could be good option to do it in page settings. Lets say we have templates like news, gallery, author, tag, movie, song itc. We have also pages with the same names. If we want page 'Video' to accept children only with template 'video' we need to create template like 'videos-container' and set it to accept only children with template 'video'. And so on with other pages and teplates. It ends with many 'empty' templates which role is only limitation child templates in specific pages. If we could limit children templates in page settings it would be enough to have one template like 'common-container'. PS: sorry for my bad english.
  22. Hi there! To allow something as simple as pagination with a little help of $_GET and math. With an additional selector offset, you should be able to get pagination easily done without extra modules. $limit = 10; $offset = $limit * $_GET['page'] - $limit; // page 1 = offset 0, page 2 = offset 10 $posts = $pages->find('template=news, sort=-created, offset='.$offset.' limit='.$limit); So far so good. The only thing missing is the markup: <div class="pagination"> <?php $pagination = $_SERVER["REQUEST_URI"].'?page='; ?> <a href="<?=$pagination.'1'?>">First</a> <!-- numbers --> <?php $amount = count($pages->find('template=news')); while ($i = 1; $i < $amount / $limit; $i ++ { ?> <a href="<?=$pagination.$_GET['page']+$i?>"><?=$i + ($offset / $limit) // 1 + 10/10 = 2 ?></a> <?php } ?> <a href="<?=$pagination.$amount?>">Last</a> </div> Kept very simple so far. But this is only one good example of how to use the offset selector. If there is already something like that implemented, I'd be glad to hear from it! Thanks in advance. Cheers, Martin Muzatko
  23. Hello ppl I'm trying to create an image banner to show in all pages of the site, and for this i created a page to hold multiple images in a field (latter im gonna deal with animating them). The page is published, So this is the tree of values i got: i can address the page with $pg_settings = $pages->get('name=settings'); it seem to be correct because print_r gets me a biiiig array if info now the problem is getting the array of images, with their respective url's. I tried: $pg_settings = $pages->get('name=settings'); // echo "<br />pg_settings: " . print_r($pg_settings->get("banners_slideshow")); // seems ok... $imgs = $pg_settings->get("banners_slideshow"); print_r($imgs[0]->get("url")); // i got nothing?? In this page i also have a non repeatable image field for the logo, so i think i cant use the images array from that page. the question remains: how do i address a field with multiples images, that is in another page? thanks for the patience!
  24. Hi, I want to delete 2 pages with $page->delete() after one another . But only one of the pages gets deleted. My code $serverpage = $pages->get($serverId); if ($action == "delete") { if ($serverpage->id) { $serverpage->delete(); //When I comment this out, $serverad further down gets deleted //if ads for that server exist, delete them $serverads = $pages->find("template=advertisement, ad_server={$serverId}"); if (count($serverads) != 0) { foreach ($serverads as $serverad) { if ($serverad->id) $serverad->delete(); //does not get deleted when $serverpage->delete() above executes. } $serverout .= "<div class='alert alert-success' role='alert'>All Ads for the server deleted.</div>"; } $serverout .= "<div class='alert alert-success' role='alert'>Server successfully deleted.</div>"; } else { $serverout .= "<div class='alert alert-danger' role='alert'>Server does not exist and could not be deleted.</div>"; } $serverout .= $serverForm->render(); } When $serverpage->delete() is executed, $serverad->delete() has no effect. When I comment out $serverpage->delete(), $serverad->delete() is working. I don't get any errors and I already checked that $serverad is a valid page object in all cases. Now I'm clueless of what the problem might be.
  25. 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?
×
×
  • Create New...