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, I have one xml FEED and I want to create pages for each item in XML via API. First time i am trying to create page with API, every thing is working fine but the issue is 1. its creating duplicate pages every time i run that XML. i have one unique field in XML called item_id & i want to create page with item_id as page name, i want to check that if page exist with item_id name before creating page. how can i do that ? Thanks
  2. Hello, I am developing an Inputfield Module for a Page Field that has the user interact with a modified InputfieldSelector. I have added buttons on InputfieldSelector to modify a hidden HTML textfield that I have appended to the module rendering. I would like to save the textfield's contents to the database. My question is, how would I do that, given that the module is of type Page? Let me know if clarification is needed. Thanks.
  3. 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.
  4. Hi Guys I have a question about the Add Page Shortcut Functionality. In General you can set the family settings on template so that you have to choose a new Parent when adding a new page of the defined template with the shortcut menu. In my case I can add new "Newsletter" Pages but I have to choose under which Parent it should be added. But as a "Clinic" - User I can only add the Newsletter Pages under the Parent Page which belongs to this User (was made with a Hook inside Page::addable / Page:editable). Because of that I only see one Parent Item in the Dropdown Shortcut Menu which is correct. Can this Selection be skipped when the shortcut menu only has one Parent to choose (Also in ProLister "Add New")?
  5. How do I get the output of a field that is a FieldTypePage? I've tried echo $page->first_name . " "; but it just prints numbers instead of picking data from that page it's referencing to. Couldn't find any info on how to use this module/field either.
  6. Hi all, I am using Processwire to synchronize Albums form a Facebook Page into Processwire. Works like a charm! I'm using two loops to synchronize the albums One loop that creates a page that stands for the "album" One loop that stores every image within the album as a child of the "album" I experienced that this loop however only synchronizes the first 25 images. I was wondering, is there any kind of limitation that comes with the page creation API? I used the following script as posted before by Ryan if I'm not mistaking $p = new Page(); $p->template = "fb_image"; $p->parent = $pages->get("name=$id"); $p->title = $hash; $p->name = $hash; $p->save(); $p->fb_image = $image["images"][0]["source"]; $p->save(); Hope someone has the answer!
  7. It would be very nice to be able to save page with common shortcut (e.g. CTRL + S on windows) in admin. Live long PW
  8. Hi, I'm working on a script that allows users to add a new Page to my installation of ProcessWire. I will explain how this script works below. The user enters some information into a simple form ^ This can include an image The form is validated with jQuery When valid, the form triggers a function through a class that handles the process I will include some of the code below. Form: <form id="entry" class="entry" method="post" action="./" name="entry" enctype="multipart/form-data"> <div class="row"> <input type="text" name="fullName" id="fullName" placeholder="Naam initiatiefhouder *" data-validation="required" /> </div> <div class="row"> <input type="text" name="projectName" id="projectName" placeholder="Projectnaam *" data-validation="required" /> </div> <div class="row"> <input type="email" name="emailAddress" id="emailAddress" placeholder="E-mailadres *" data-validation="required" /> </div> <div class="row"> <textarea name="projectDescription" id="projectDescription" placeholder="Beschrijf uw initiatief *" data-validation="required"></textarea> </div> <div class="row"> <input type="file" id="image" name="image" data-validation="mime size" data-validation-allowing="jpg, jpeg, png, gif" data-validation-max-size="2M" /> </div> <div class="row"> <input type="submit" name="submitEntry" id="submitEntry" value="Insturen" /> </div> </form> So basically the "image" field is the field that allows the user to add a file (jpg, jpeg, png, gif - max 2mb). Now, when all the information is valid it will post this form through the following function. public function pushEntry ($input, $file) { // Unset the array $this->array = []; // If there is any data if ($input) { // Get some of the variables needed $this->name = $this->sanitizer->text($input->fullName); $this->email = $this->sanitizer->email($input->emailAddress); $this->project = $this->sanitizer->text($input->projectName); $this->description = $this->sanitizer->text($input->projectDescription); // Get the date $this->date = date("d-m-Y H:i:s"); // Generate the title $this->title = "$this->project - $this->name"; $this->duplicate = $this->pages->find("title=$this->title"); // Generate the array $this->array = [ "title" => $this->title, "fullName" => $this->name, "emailAddress" => $this->email, "projectName" => $this->project, "projectDescription" => $this->description, "date" => $this->date ]; // Create the page $new = new Page(); $new->template = $this->templates->get("entry"); $new->parent = $this->pages->get("/entries/"); foreach ($this->array as $key => $value) { // Foreach key and value, create a new page $new->$key = $value; } // Check if there is any duplicates if ($this->duplicate->count() == 0) { $new->save(); } else { echo "Dit initiatief bestaat al."; exit; } // If there is an image if (!empty($file["image"]["name"])) { // Some variables $this->path = $this->config->paths->assets . "files/$new->id"; // Set the extensions $this->extensions = [ "jpg", "jpeg", "png", "gif" ]; // Do the Wire $this->image = new WireUpload($file["image"]["name"]); $this->image->setMaxFiles(1); $this->image->setOverwrite(false); $this->image->setDestinationPath($this->path); $this->image->setValidExtensions($this->extensions); // Execute and check for errors $files = $this->image->execute(); // Add the image to the page $this->fileName = $file["image"]["name"]; $this->fullPath = $this->path ."/". $this->fileName; // Move the file $new->image->add($this->fullPath); // Unlink the file unlink($this->fullPath); // Save the page $new->save($new->id); } } // Return the array return $this->array; } The script adds a page to my installation of ProcessWire perfectly; except for the file upload. I encounter the following errors; Warning: unlink(C:/wamp/www/gezondsteregio/site/assets/files/1135/dekkleden_header.1919x301.jpg): No such file or directory in C:\wamp\www\gezondsteregio\site\templates\controllers\home.php on line 106 Warning: filemtime(): stat failed for C:/wamp/www/gezondsteregio/site/assets/files/1135/dekkleden_header.1919x301.jpg in C:\wamp\www\gezondsteregio\wire\core\Pagefile.php on line 324 Warning: filemtime(): stat failed for C:/wamp/www/gezondsteregio/site/assets/files/1135/dekkleden_header.1919x301.jpg in C:\wamp\www\gezondsteregio\wire\core\Pagefile.php on line 324 I am really curious if someone can help me with this problem. I have tried this script on both my localhost (regular Apache) and my webhost (Fast CGI). Regards, Jim Oh, and I use the following script to trigger the function. $entry = new Entry(); // If there is a post if ($input->post->submitEntry && !empty($input->post->fullName) && !empty($input->post->emailAddress) && !empty($input->post->projectName) && !empty($input->post->projectDescription)): // Push the entry to the controller $entry->pushEntry($input->post, $_FILES); endif;
  9. I'm just wondering if there a way of creating block like functionality similar to say Episerver / drupal blocks?? I guess i could treat the template as a view that loads in sever partials (kinda like blocks) ?? Any ideas on this would be great.
  10. Hello guys, I have a Page field for my own global media gallery. When I select one page, I get following PageArray via the API: object(ProcessWire\PageArray)#287 (7) { ["hooks"]=> array(2) { ["PageArray::render"]=> string(60) "MarkupPageArray->renderPageArray() in MarkupPageArray.module" ["PageArray::renderPager"]=> string(56) "MarkupPageArray->renderPager() in MarkupPageArray.module" } ["count"]=> int(3) ["items"]=> array(3) { [0]=> string(29) "/files/unpublished/" [1]=> string(25) "/files/animals/" [2]=> string(23) "/files/sloth/" } ["total"]=> int(3) ["start"]=> int(0) ["limit"]=> int(0) ["selectors"]=> string(0) "" } So I select 1 Page and get 3 Pages in return? How can this happen? From the interface here, everything looked fine: Here is the stuff that created the field (if needed): $data['getFileField'] = new Field(); $data['getFileField']->type = $this->modules->get('FieldtypePage'); $data['getFileField']->name = 'fooBar'; $data['getFileField']->label = $this->_('File select'); $data['getFileField']->parent_id = $files['page']->id; $data['getFileField']->inputfield = 'InputfieldPageListSelect'; $data['getFileField']->labelFieldName = 'title'; $data['getFileField']->allowUnpub = 1; $data['getFileField']->description = $this->_('Select one file or folder. If folder is selected, the first file inside of it is used.'); $data['getFileField']->icon = 'file-o'; $data['getFileField']->save(); Is this a bug? EDIT: Now I am pretty sure it is a bug in PW (3.0.10): If I select a page via the Page field, the PageArray is only with this page. If I change the page via the Page field (and save), I get the old one plus the new one. So somehow it does not get reseted on new selection.
  11. Hey All. I am trying to change the label of a field after a certain page is saved. This field is not part of the page that is saved but the label should be updated with the page name. $pages->addHookAfter('saved', function($event) { $page = $event->arguments[0]; if($page->template->name == 'service-type') { $cid = $page->id; $this->message($cid); /* find field servicetype_rangeslider_$cid and set label */ // how to access $fields?? } }); I have this hook in my /site/ready.php. Now my remaining problem is, how to access $fields array or in general, how to get the field? I am thankful for every hint, thanks!!
  12. Hey all. I have a question concerning templates and a possible setting to disallow/prohibit to view pages that are using certain templates. I have a couple of templates that are not complete page-templates including header/footer but are sections-templates. E.g. I have a template called 'Case' and every page using this template can add section children, e.g. first a section-video, then section-textblock, ... Doing this, the user can create its own cases out of building blocks. However, up to now one can select 'view' in the page-tree in the admin panel to view each sections. This view failes, as they don't have a header/footer. Can anyone of you think of solution how to disable that one can view pages with template section-* ? Thanks a lot in advance!
  13. I have a page that has a field that contains a page. How do I use the API to update a page select field in the page's page? Example: User page has field "member" which points to a member page. Member page has field "gender" which points to page for selecting gender. How do I change the page the gender points to from the user page? I've tried $user->member->gender = 123; where 123 is the new page ID. Also, $user->member->set("gender", 123); Both of these seem not to work.
  14. Hi, I've been using PW for a pretty long time now, and this kind of thing is happening for the very first time. I'm setting up an API for the App I'm creating for my client. So I've created a hidden page called API which is located right under the Home. When I'm trying to write code for API and test it, the output is only visible for logged in user, i.e., the output is only available if I'm logged in, which is not going to be the case when I'm using app to request JSON. So, question is, how to keep the page hidden but accessible to guest user? I checked the permissions under settings tab. Who can access this page? Tab says it's accessible to guest & superuser but for some reason, it's only working for superuser. What am I doing wrong? Thanks.
  15. I have a page field calles select_multi_dates. I set a php specific selector like this $currentActivity = $page->parent; return $currentActivity->activity_create_date; It shoud give me all pages from the activity_create_date pagetable, what it does well but the problem is that the label is shown as timestamp. And here is the configuration of the page field: What I'm missing?
  16. Hi all, friends. Still here to fight against problems I can't figure out (yet ). I've looked for a solution into the forum but seems I'm not able to find the solution, still. I'm finding myself to fight with this weird issue where I've users with (finally) correct permissions to access and edit the pages they created, then I've have some fields in my template (which I want my users are able to create from the field directly) where parent and template (and selectors for having ordered items to choose from) are correctly set up (I think), but for some weird reason I can't create pages (the link doesn't appear as it should) from these fields. Already tried to adjust permissions for roles and fields, but with no positive results. Hope in your help (as usual )
  17. I appreciate all the help thus far in learning how to navigate Processwire. However, I have hit a road block. I have an Image Field in one of my templates (it is being used in a repeater), and I would like to assign a preexisting page's url to the image . Ie: <a href="url-to-page"><img src="code-for-image" /></a> However, maybe I have missed something, as I set up the field (homepageImg) to be a "page select" but nothing is currently populating the dropdown. I am merely trying to get all the children of the parent (that the current page is in) and display them. I thought this would make it easy for someone to set the URL on the fly. Any help would be appreciated.
  18. I want to set the pagestatus of a admin-page to hidden when a user is logged in which has the role "company". I did this in the admin.php but it doesn't work. What I am missing? if(wire('user')->isSuperuser()){ $pages->get(1265)->removeStatus(Page::statusHidden); } else{ $pages->get(1265)->addStatus(Page::statusHidden); }
  19. Is it possible to make a "Add New" Shortcut-Button on a Custom Admin Page e.g in the ProcessDashboard Module instead on the Sitetree Page?
  20. Hi, I've noticed the following entries in my PW error log SQLSTATE[HY000]: General error: could not call class constructor [pageClass=Page, template=] The following is the associated link that is logged as well. http://localhost:8888/processwire/page/list/?id=id&render=render&start=start〈=lang&open=open&mode=mode Any ideas where I can look to get to the bottom of this?
  21. I have a template called "activity" with two pagetable fields. Fields: activity_create_cast activity_create_date activity_create_cast: uses "cast" template for creating castpages. the cast template contains a pagefield called select_multi_dates. activity_create_date: uses "date" template for creating datepages. the date template contains a pagefield called select_activity. Now what i want is create a cast with activity_create_cast and I want that the selection of the select_multi_dates pagefield should be the pages wich i created before with the activity_create_date. How can I achieve this under the select_multi_dates pagefield with a PHP-Selector? I know its complicated PHP-Selector. Hope you can help me. Thanks for your attention. Nukro
  22. Hi there, I was wondering if there is anyway of getting some basic page stats (like number of times a page is visited etc) without having to resort to 3rd party tools like Google or other analytics tools? Are there any built-in-tables or logs that keeps this information? Thanks in advance.
  23. 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/
  24. I'm trying to achieve a specific selection for a pagefield for specific users. My pagefield should detect: If the current user is a superuser return all address-pages and when it's not a superuser, return all address-pages which the current user has created. It works fine for the superuser but i have no selection in all the other users. if(wire('user')->isSuperuser()){ return $pages->find("template=address"); } else{ return $pages->find("template=address, created_users_id=wire('user')->id"); }
  25. I have the problem that i cant render a fredi link to a page which i choosed from a pagefield from a user. i have a user called "test-user". This "test-user" template has a pagefield called select_organiser which contains all the organiserpages. My approach: $organiser = $user->select_organiser; <li>'.$fredi->setText("<i class='fa fa-pencil'></i> Veranstalter bearbeiten")->renderAll($organiser).'</li> What I am doing wrong?
×
×
  • Create New...