Jump to content

Search the Community

Showing results for tags 'template'.

  • 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. It would be fantastic if we could set different configurations for CKEditor fields based on template or user roles. Like described on https://weekly.pw/issue/14/ under "More CKEditor upgrades", we can use config files in /site/modules/InputfieldCKEditor/ to store settings per field. E.g. for the body field this would be /site/modules/InputfieldCKEditor/config-body.js. Maybe this logic could be extended to something like /site/modules/InputfieldCKEditor/config--field-body--template-home--role-mycustomrole.js. I was coming over from Joomla to PW couple of years ago and there we had an excellent CKEditor integration called JCE where you could define settings per user role etc. Maybe I am wrong but up to now we need to create additional fields if we need editor config settings per template. If there already is a way to do that I'd be happy to know.
  2. Maybe I have messed up somewhere here (As it is working on my local server), but an image used as the header on the live branch has just suddenly "disappeared". I imported all of my fields from my local branch (which included the pageHeader image field), and loaded in my content just fine. Yesterday I was just going through a few of the demo pages and the header image is no longer displaying on site. I looked at the page itself on the backend and the image is displaying there, just not in the front end. Is it possible for the data to corrupt over a few weeks? If you look at the screenshot, it looks like the code isnt even pulling in the image to the src.
  3. hi! i'm trying to get the label of my field that i use in two templates with different name. so i'm trying to get the label through the template. so my code is echo $templates->get("home")->fieldgroup->get("text")->label; but it gives me the general field label not that i'm using for the home template any idea?
  4. On my dev (localhost) my gallery appears to be working just fine. It is set to "Automatic", and if I drop in 8 images all of them upload in the order I selected and all save out. However on my production server, the images upload all out of order and then it deletes 4 of them. Has anyone else had this issue or know how to solve it?
  5. Ok, so I have been scratching my head on this one for the last hour. I had three repeaters that I needed to delete from the list to create some new ones (I removed them from the template via actions). However when I go to delete the repeater, it is saying it is still use by 3 other pages. I am at a loss of what to do.
  6. Hello, I have a site with users that have a custom user template setup on PW 2.7.2 stable. Custom user template is "member" and role for those users also "member". The site has a frontend dashboard where users can edit their profile, events etc. I can login with this user type to the backend fine and the permission settings are all working. When I login to the frontend, I get this error: "Fatal error: Maximum function nesting level of '10000' reached, aborting! in .../wire/core/Wire.php on line 333"; I already raised the xdebug.max_nesting_level from 1000 to 10000. When I set it to 100000, the server disconnects. I can see that the user gets logged in with $session->login($uname, $pass) before the error is thrown. EDIT: When I reload the login page after the error shows with the now logged in user, I get this error: "Fatal error: Maximum function nesting level of '10000' reached, aborting! in /var/www/utgpw/wire/core/Fieldgroup.php on line 61" But a $session->redirect($dashboard->url) seems to cause the error. If I logon with a test user that has role "member" but the regular user template, I don't get the error and get redirected to the dashboard fine. All the code in my dashboard template is working. Actually, the whole login and dashboard logic for the frontend is copied from another site where it has been working fine for over a year now. So I guess the problem is related to how the custom user templates are handled in the core. My setup for the custom user template has also proven to work without issues in 2 other sites. I have spent hours on debugging already and now I'm lost. Any ideas that point to the cause of this would be much appreciated.
  7. I was struggling a bit getting all subfields of a field if type is unknown. I made a small function for use in templates which returns an array() of all properties of (maybe any?) pagefieldvalue. If there is something similar in core (which I couldn't find) please let me know. Tested it with Fiedtype Options, Page, ProfieldsTable. Feel free to use it. /** * ProcessWire UsefulSnippets * * How to get all properties, subfields of any field if you don't know the type only if value is set * @return array */ function getProperties($fieldvalue) { // multiple value field if ($fieldvalue instanceof WireArray) { $result = array(); foreach ($fieldvalue as $subfieldvalue) { $result[] = getProperties($subfieldvalue); } return $result; // single value field with subfields } else if ($fieldvalue instanceof WireData) return get_object_vars($fieldvalue->getIterator()); // single value field else return $fieldvalue; } // Example var_dump(getProperties($page->myfield));
  8. Setup: PW version 2.7.1 dev template cache is disabled Chrome Canary is opened with disabled cache and in inkognito view mode When I make a change to a template file (say the basic home.php) I want to immediately see that change after refreshing the browser. Example: This is the content of home.php: <?php echo "bla"; I browse to the root page and see the "bla" output. I change the code to <?php echo "bla1"; and save the file. After that I immediately reload the page in the browser and I don’t see the change to "bla1". Only after multiple browser reloads (at times also more than 20 reloads) and "hard" reloads does the change appear. What I tried to do: set $config->dbCache, $config->sessionFingerprint and $config->sessionChallenge to false in config.php delete all sessions re-save the page in the ProcessWire backend and reload the browser page completely delete the browser history (cookies, cache, everything) after the first visit to the page Nothing helped. Questions: Can someone replicate this behavior? What can I do to achieve the desired behavior? Thanks a lot in advance for any help.
  9. Hi everyone, I know the answer is right in front of me, but I've searched it for days already. I guess I'm still a beginner... please help me! I'm using the multi-language site profile, suggested in the installation of processwire, if that helps. I want to apply the fancybox only to the images of one template. Fancybox is already running, I put the necessary code in the _main.php file. <link rel="stylesheet" href="<?php echo $config->urls->templates?>scripts/fancybox/source/jquery.fancybox.css" type="text/css" media="screen" /> <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script> <script type="text/javascript" src="<?php echo $config->urls->templates?>scripts/fancybox/source/jquery.fancybox.pack.js"></script> <script type="text/javascript"> $(document).ready(function() { $(".gallery").fancybox({ }); });</script> Therefore I created a new template php called "gallery.php" and put that code inside. foreach($page->images as $image) { $thumbnail = $image->size(150,100); echo "<a class='gallery' rel='gallery-1' href='{$image->url}' title ='{$thumbnail->description}'><img src='{$thumbnail->url}' style=' padding: 5px;' ></a>"; } Now it shows the kind of gallery I want to have, but at the wrong possition of the site. I just don't know what I have to write in there to change the position. perhaps it is something like $content =... , but I already tried every combination I could think of and I've looked at all the tutorials I could find. I'm thankfull for any help, Leo
  10. Hi all, Real newbie question here; how do you get a child page's title from its parent's ID? Let me elucidate. I have a page type of Dam with 600+ dam child pages. Each child dam page uses a template called dam, and one field within the dam template is country, which is linked to a Countries page type. I've written code to return all the dams in a certain country, but it returns that country's ID as it appears in the dam template's country field. Having attempted and failed miserably to get the title of the appropriate country's child page's title from the ID, I thought I'd ask those far more knowledgeable than myself! I appreciate this is probably day one, lesson one of how to work with Processwire, but I'm still negotiating the learning curve Tony.
  11. Hi I have a question about the "Name format for children" option for Templates. This option only shows up when i allow 1 single template under the "allowed templates" option. The Scenario: I have a template called "activity", the activity template can have or it is allowed only to have 4 template types as children: date, cast, image and video. My Problem is that i want that only the page name of the date pages are genereated automatically with the "Name format for children". But this option is only working when i allow only 1 template as children. How can I achieve, that the "Name format for children" works also when its allowed more than 1 children. Here is the Tree structure for visualization:
  12. Hey guys, I'm trying to build a submit form with the ProcessWire API. After the form is submitted its data should be saved into different pages. I've followed Soma's great tutorial and wanted to improve it for my use case: Instead of adding every field manually to the form I already managed to automatically read out the fields that belong to a specific template like this: // Build form $form = $modules->get("InputfieldForm"); $form->action = "./"; $form->method = "post"; $form->attr("id+name",'$page->name'); // Build fieldset $fieldset = $modules->get('InputfieldFieldset'); $fieldset->label = 'Personal Data'; // Read out template fields and append them to the fieldset $registration = $templates->get("registration"); foreach ( $registration->fields as $field ) { $field = $field->getInputfield($page); $fieldset->append($field); } $form->append($fieldset); // more fieldsets... // Submit $submit = $modules->get("InputfieldSubmit"); $submit->attr("value","Anmelden"); $submit->attr("id+name","submit"); $form->append($submit); This seems to work great – with just one little restriction: Instead of the global field labels I would love to get the template specific settings for each field (defined within the template). E.g. in this template I'm using a body-Field not labeled as "Body" but as "Description". Same would be great for things like field's columnWidth, required properties and Co. Is this possible? Thanks a lot for your help! Nik
  13. Lets say i have a template with the following fields: title address_street address_additional_road address_zip_code address_place address_country address_email address_tel_1 address_tel_2 I want to output a table with the label of the field and the value of it. $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 the fields: $all_fields = $page->fields; foreach($all_fields as $field){ $out .= "<tr class='odd'><th>{$field->label}</th><td>{$page->get($field)}</td></tr>"; } $out .= "<tr class='even'><th>erstellt von</th><td>{$page->createdUser->name}</td></tr> <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>"; $out .= " </table> </div>"; In the foreach, it only outputs the title and I also get warnings: Warning: Illegal offset type in /Users/praktikant/Sites/Kulturdatenbank.pw.2.0/wire/core/WireData.php on line 41 Warning: Illegal offset type in isset or empty in /Users/praktikant/Sites/Kulturdatenbank.pw.2.0/wire/core/WireData.php on line 39
  14. I have been looking into this for awhile, but really have not found any module or "template" that handles this. On my test site I have about 80 pages (some nested and some as parents), which is really making the page tree a bit cluttered. I was wondering if anyone else had seen/used a template/module to make the page tree a little more "user friendly" and a bit less cluttered. I know I could probably create a new admin layout for this, but I had no idea where to start.
  15. So I have set up a pretty basic template for pages using: <?php include('header.inc'); ?> and page structure is something like mydomain.com/whales/page-name I was hoping to have a different header.inc for every group of pages (so based on the parent page include the relevant header.inc). For example, /whales/ would have a different header than /goldfish/ (sorry for the silly examples). However, I can not for the life of me find a solution, nor am I having any luck in creating the desired outcome. Has anyone done anything like this before? Am I approaching this is the wrong way?
  16. Hi everyone, I'm starting to code PW side of my first ever PW project. Really excited to see how it goes. While starting out I'm planning a template approach to use in the project mostly relying on wireRenderFile method. As it is my first project I wanted to make sure this won't cause me problems in the long run. Here is how I started out: I have two functions in _func.php as helpers. One of them is wrapper for wireRenderFile and the other is appender for $content for not using $content .= everywhere I have a global variable called $site. I normally avoid global variables but in this case I'll only have one and its not so different than using $homepage or $title before the includes (or is it??). I'm thinking about making a module for this to keep _init.php clean And in the _main.php my code is like that, with the common areas for pages. For the content of pages, I echo $content for the page content I gathered. For example, for basic-page template file: You can see usage of both functions here. That's all for the start. I'm trying to keep it simple to prevent going out of my hand. Do you see any "do not" or "should not" points here, or have any kind of recommendations? Thanks ahead
  17. Short question: Is it possible? Longer explanation: I have a rather big product cataloque which is viewable for registered users only. We now want to open it to the public. In the valued spirit of "I'd rather take 30 minutes to script something than 20 minutes to do it manually" I am looking for a way to change the access of 50 or so templates to "viewable for guest" but I can't find an API method. Can anyone help? Thanks, thomas
  18. I have a question on how to group search results by template, with pages sorted alphabetical (as standard) in each group. I have a film blog running ProcessWire. It has lots of posts, ratings, categories, ratings, directors, actors and tags, my search result is getting crowded by all this pages after a while. These pages have different templates. Until now I have had badges with the template label by their title in the search result. I am wondering if there's a simple way of coding it to group the search result, kind of like how IMDb does it: Titles are grouped first, then names second. Like this. To illustrate, here's a part of my structure, template name in brackets: --- Main (home) Blog (posts) Movie 1 (post) Movie 2 Actor (actors) Actor 1 (actor) Actor 2 Director (directors) Director 1 (director) Director 2 Tag (tags) Tag 1 (tag) Tag 2 --- And here's how I would want my search result to show, e.g. if all these pages where to mention Tom Hanks somehow: --- Movies: Movie 1 Movie 2 Directors: Director 1 Director 2 Tags: Tag 1 Tag 2 Actors: Actor 1 Actor 2 --- I am in a learning process, and I am sure there are other problems that will appear when considering usability. Limits within groups, etc. But for now this is a way of sorting that I might also want to use elsewhere later on. Whereas I have headings and results in separate lists. (PS: I have read a couple of posts on group sorting based on parent ID, but none of them was exactly what I was looking for.)
  19. 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
  20. Hello everyone, Been working rough 5-6 months with this beast and i gotta tell you that it's almost perfect Of course every software has it's ups and downs, just like life does and nothing is perfect or meant for everyone, but here we go... I think database structure is about correct and flexible enough, what i don't like is that i can have similar field with 3x different prefix just because i need different control data for that same field. How about if template would control fields data instead of field? Field could have it's own control data as default, but i would really like to see that template could at least control some data, like visibility, appearance, required, stuff like this. Why? Because past 5-6 months i faced fact that for example when i need to custom admin interface for some template i would like to use same field over and over again, but it's kind of impossible when width can be 50%, 33% or 100% for different templates, data how ever is very same. Feels so stupid to create field over and over again, when it could use existing database tables. You already have control tables for fields and data tables separated, which is good model, so how big deal would this to be to implement something like this? If this already exists and i'm blind, lemme know and i'll buy you beer I hope i'm not the only one feeling like this, cheers for listening
  21. You want to display pdf files as pages in frontend? Go here: Create a template file 'showpdf.php' <?php $file = $page->pdf->filename; header('Content-Type: application/pdf'); header('Content-Disposition: inline; filename="' . basename($file).'"'); header('Content-Length: ' . filesize($file)); readfile($file); Create field 'pdf' of type file and add it to your template. Create a page using the template 'showpdf.php' Add pdf to page field 'pdf'. Done. To get save option instead of display use 'attachment' instead of 'inline' like header('Content-Disposition: attachment; filename="' . basename($file).'"');
  22. Hello All, I have an issue editing certain pages with specific templates. I noticed this issue after migrating from MAMP to a production server. Not sure if there's a relation there but just had to mention it. 'Error: Call to undefined method DirectoryIterator::getExtension() (line 104 of /var/www/vhosts/.../httpdocs/wire/core/Pageimages.php) This error message was shown because you are logged in as a Superuser. Error has been logged.' When line 104 in Pageimages.php is commented out i'm able to edit the pages successfully. Any help or information will be appreciated. PW Version 2.5.25 DEV
  23. Just found an article about templating and it really made me smile: Your templating engine sucks and everything you have ever written is spaghetti code (yes, you) I guess many people here on PW don't give much attention to templating engines as PW runns smooth even whithout one. But the concept of DOM Templating really looked interesting to me. I really would like to hear your opinions!
  24. I'm trying to fetch an array of pages that use a certain template with: $my_array = $pages->find("template=xxxx"); But for some reason, it won't return anything for the template that I'm targeting. If I change the template name to my basic page or news templates, for example, I get a list of pages output, but not for the template I want. Is there some setting I've inadvertently set that would cause the template's pages to not display? The template is being used for pages on the site and they display OK as single entry pages. Or could it be related to an issue I had with the same template yesterday where I was adding a new field to the page, and then when I went to edit the page with content in the new field, I'd get returned to the same page I was on, i.e. /processwire/page/edit/?id=XXXX but it would display the 404 template instead? And the data I'd tried to enter wouldn't be saved. The template only has title, multiplier, table and file fields attached to it. And the table field is also modified by the TableCSVImportExport module.
  25. Is it possible to use a wordpress template or any template for processwire? I'm sorry. I'm a complete beginner to this codes. But I'm willing to learn. P.S. I'd like to use this template templatemo_372_titanium.zip
×
×
  • Create New...