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. Hi, Is there a way we can make the Selectorfield to choose system templates ? Currently I have created a Selectorfield and added to a template. Now when I create the page, the selector only shows the templates that are not system templates. I would like to show the system templates also in the list if possible.
  2. Hi there, I've created this sample home page As you can see there are some repeating parts (wide image, heading etc.) but they are all followed by a part that differs from the rest. Notice also that the top wide image is higher than the other two. For the images I use the CroppableImage module (it's in alpha but so far it looks stable). For my client I want the admin as simple, intuitive and logical as possible. What would be the best practice to set up the back-end template. Thanks Alfred
  3. Hi, recently I asked a question regarding the PageNameURL generator. Is it also possible to use the generator within a template to create urls out of field content? I have an array representing a list of names, some of them containing various special characters, i.e.: Tomas Tranströmer José Saramago Kenzaburō Ōe Gabriel García Márquez Halldór Laxness François Mauriac Władysław Reymont Now I'd like to create urls like: /author/wladyslaw-reymont or /author/kenzaburo-oe Is there a PageNameURL generator function I can use to convert the special characters? Thanks a lot! Sarah
  4. As described in this post (https://processwire.com/talk/topic/8551-custom-urls-for-pages/?p=82742) the option 'Name Format Children' under the tab 'Family' in template settings doesn't work properly and also not as expected. I had a look inside the code and made some changes which are working properly, which offers much more options, more consistency and less code too. The result is the following. You have 3 Options for generating name and title, which could be combined in endless variations. Name is always derived from title, same like creating pages manually. type date: if function detects # character anywhere in the string, conversion will be: deletion of # and string will be used as format parameter for PHP date() function type field: if string is a fieldname of the parent page the value of this field will be used type string: if string doesn't fit to the 2 preceeding it will be taken as it is All parts (separated by comma) will be composed in the order of setting. You can use unlimited numbers of parts I made a pull request on github: https://github.com/ryancramerdesign/ProcessWire/pull/831 Example screenshots Setting ... will result in
  5. 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.
  6. Hi all, again this a more or less PHP-related question: I'm trying to reuse renderNav from the blog.inc file as found in the blog profile. The function accepts parameters: function renderNav($headline, $items, $currentURL = '', $mobile = true) The comment sections says: @param array|PageArray $items May be an array of Page objects or array of ($url => $label) Taken as it is the function outputs the title of the page objects in $items which works fine BUT I would like to output it a different field value ($page->client instead of $page->title in my case). This is where I am stuck with my limited PHP skills. How can I make the function output another field value than $page->title? How would I "put together" an array that contains this field values so that I can assign it as key => value pairs to $items? Thanks
  7. Hi all, I'm trying to adapt the blog profile to my needs. In my template blog-list.php I have the following: $content = renderPosts("limit=10", true); which populates $content in main.php. renderPosts() I have taken as it is from blog.inc in the blog profile: /** * Given a PageArray of blog entries generate and return the output. * * @param PageArray|Page $posts The entries to generate output for * @param bool $small Set to true if you want summarized versions (default = false) * @return string The generated output * */ function renderPosts($posts, $small = false) { if(!$posts instanceof PageArray) { if($posts instanceof Page) { // single page $post = $posts; $posts = new PageArray(); $posts->add($post); } else if(is_string($posts)) { // selector string $selector = $posts; $posts = wire('pages')->find("template=blog-post, sort=-date, $selector"); } else { throw new WireException('renderPosts requires a PageArray, Page or selector string'); } } foreach($posts as $page) { if(empty($page->summary)) { // summary is blank so we auto-generate a summary from the body $summary = strip_tags(substr($page->body, 0, 450)); $page->summary = substr($summary, 0, strrpos($summary, ' ')); } // set a couple new fields that our output will use $page->set('authorName', $page->createdUser->get('title|name')); $page->set('authorURL', wire('config')->urls->root . 'authors/' . $page->createdUser->name . '/'); } $t = new TemplateFile(wire('config')->paths->templates . '/markup/posts.php'); $t->set('posts', $posts); $t->set('small', $small); $out = $t->render(); // if there are more posts than the specified limit, then output pagination if($posts->getLimit() < $posts->getTotal()) $out .= $posts->renderPager(); return $out; } As you can see, the function makes use of /markup/posts.php. Within posts.php I have the following: // display a headline indicating quantities $start = $posts->getStart()+1; $end = $start + count($posts)-1; $total = $posts->getTotal(); if($total) echo "<h3>" . sprintf(__('Posts %1$d to %2$d of %3$d'), $start, $end, $total) . "</h3>"; This echoes the quantities headline as expected to $content but I would like to have it echoed to my $sidebar variable instead which currently doesn't work as it is part of renderPosts(). My question: What would be the best strategy/solution to assign $total to my $sidebar variable instead to $content? Thanks
  8. Today I wanted to add some settings and extra fields to my user template (which went fine) and realized, that if an editor uses the profile link in main navigation, he doesn't see the extra fields i or other plugins added. In this view are only password, mail address, language and admin theme available. But if this user has the right to administer users, he could go to his "other" profile page (/processwire/access/users/edit/?id=123) and see all the additional fields and edit them. Why is it not possible to edit all fields in the profile view. I can't give all my editors user admin rights, but I want the to be able to edit their profile with all the additional fields (in the backend). How could i accomplish this? Thanks!
  9. I just installed ProcessWire for the first time and I've perused the documentation but haven't seen an explanation of the template files that start with an _. Can someone explain to me how those work? Also, how come they have an opening php tag but no closing tag? Is there anything that explains this in depth?
  10. Is there a way of suppressing the automatic loading of the Templatefile? I was experimenting with Somas template approach https://processwire.com/talk/topic/740-a-different-way-of-using-templates-delegate-approach/ The problem is that you have to bend all Templates to a single file. I thought of putting the script into the _init.php($config->prependTemplateFile) That way you can use the default template structure. But if i do this, all templates get included again after _init.php is loaded. So now i am thinking about if there is a way to suppress that additional loading.
  11. 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.
  12. Hi Forum, it seems as if I have a PHP question I'm unable to answer myself. I've tried for almost three hours now but I can't find the answer, why my code isn't working as it should. This is, what's going on: I have a central _functions.inc with this function: function renderReferenceList() { $page = wire('page'); $pages = wire('pages'); $page = $pages->get(1065); $page = $page->children("limit=15, sort=-date"); foreach($page as $child) { $out = "<div class='referenceTeaser post'>"; $out .= "<h3 class='articlehead'>{$child->headline}</h3>"; $out .= "<p>" . $child->summary . "<a href='{$child->url}'><i class='more'>Referenz ansehen</i></a></p>"; $out .= "</div>"; echo $out; } } Next I have a page template with this code: <?php include_once("./_functions.inc"); /** * Referenzen template * */ if ($page->id !== 1065) { $content = $page->body; $headline = $page->headline; $sectionhead = "Projekt"; $logo = $page->widget_logo; $logo = $logo ->single_image; $sidebar = "<div class='widget'>" . "<h2 class='sectionhead'>Kunde</h2>" . "<img class='logofile' src='{$logo->url}' title='$page->title' alt='$page->title' >" . "</div>"; } else { $sectionhead = "Referenzen"; $content = renderReferenceList(); } include("./_page.inc"); And I have a _page.inc with this code: <div id="main" class="grid-66 mobile-grid-100"> <?php echo "<h1 class='sectionhead'>$sectionhead</h1>"; if($headline) echo "<h2 class='articlehead'>$headline</h2>"; echo $content; ?> </div> <!-- /#main --> The problem is: The code for the else statement is working perfectly fine, it renders all div.referenceTeaser with the appropriate content, except that it does so on top of my markup directly after the opening body tag and not - as it should - within div#main ... var_dump($content=== null); returns true but no notice. What am I doing wrong? Thanks for your help before I'm going mad about this...
  13. Hi all I have built my own module for processing forms on my site. The module does check to see of the request was forged or not, but I am unable to inset the token name and value into my template. I use Twig for my templates, and this is what I'm calling: <form data-form-ident="contact-form" data-form-token-name="{{ this.session.CSRF.getTokenName() }}" data-form-token-value="{{ this.session.CSRF.getTokenValue() }}"> The output for that is an empty string. Could it perhaps be because I am using Twig? Side note: disabling Twig is not an option as the templates I'm using are very complex - it would be a darn mission to revert to native PHP. (PW 2.4.0)
  14. I`m trying to tag a bunch of templates via the API (I mean tagging in the admin for sorting purposes). Is that possible? Coming from this post I tried this code, but it doesn't work: $p = $templates->find("name=post|posts"); foreach($p as $pt){ $pt->tag = 'blog'; $pt->save(); } Thanks!
  15. Hi there, today I was playing around with Bootstrap 3.1 and PW. I downloaded a boilerplate template for Bootstrap3.1 from initializr. Then I took a virgin PW 2.4 install and merged the initializr files with the files in PW template folder. I didn't touch any of the content and tried to replicate the site-default template as close as possible with Bootstrap markup. Only thing I added is a carousel instead of the random image. The result is a default PW install with Bootstrap look. For the main menu, I took Damienov's rendering function from here. To install my template: 1. Do a default PW 2.4 install 2. Unzip the attached file 3. Replace the original site/templates folder with the one from the attached zip file. The result can be seen here: http://pwboot.webseiten-fuer-alle.de/ templates.zip
  16. I just got started with ProcessWire and am enjoying it so far. I followed instructions in a post by Ryan to set up an "author" role, but I have run into some trouble getting permissions for a template to take effect. Here is what I have done so far: Added the "page-publish" permission under the "Permissions" page. Created a role called "contributor" (instead of "author") for my website. The "contributor" role has the "view pages" and "edit pages" permissions checked. Created two templates called "articles" and "article" for individual posts. The access settings for the "articles" template for the "contributor" role has: "view pages" and "add children." The "article" template for the same role has: "view pages," "edit pages," and "create pages" checked. Created a page called "Articles" that is hidden and uses the "articles" template. I logged into a test user which has the "contributor" role and it just shows the "view" link when I click "Articles" in the page list. If I go to the "add" link path from the admin user for the "Articles" page and visit it under the test user, it says "you don't have access to add pages here." I would like the "contributor" role to be able to create new article posts, but the permissions did not seem to take effect. If anyone has any ideas on what to do, please let me know. Thanks for taking the time to read this.
  17. hi there, is it possible to use a textformatter on a string/field in the template without applying it to an inputfield in the field settings? i searched the forum but didn't found any solution … thanks!
  18. I'm working on a site with an about-the-team page where we have a sub-page for each different area of specialty. Each one of these pages will have a list of people who are in that specialty, this list built by pulling 'person' pages that were assigned to that specialty page through a page field. With me so far? Here's the fun part. I want to add a "level" to each of the people that show up on a specialty page. So let's say I'm on the Widget Managers specialty page, and I have the 'people' page field set to pull Alice and Bob to appear listed on this page. But I want Alice to be a 'senior' widget manager and Bob to be a 'junior' widget manager. I could just put a field in the Person page type that lets me set that person's level, but wait! A person can be assigned to more than one specialty page, with different levels on each one! So Alice might be a senior widget manager and a junior doohickey wrangler. She has to show up on the widget managers page as senior, and on the doohickey wranglers page as junior. Ideally, I'd have a repeater field containing two page fields, one to select a person and one to select their level on the current specialty page, but repeaters can't contain page fields. Anyone know of a way I might approach this?
  19. Hi all! i have noticed that if enable the cache (for example on homepage), if I switch language the page is always the same, so i imagine that cache file is the same for any language. I wonder if there is any option that can save one cache file for each language. Alessio
  20. Hi all It would be great if I could create some new templates (php code) from admin menu in backend without to use FTP client Somethink like this -->> What do you think about it?
  21. Hello, I'm new from PW. I had seen it a few months ago, I had watched Ryan's video and... few months had passed ! So recently, I searched hours and hours on the web a better solution for my blog than Wordpress. I had tried many CMS and suddenly I remembered : ProcessWire So, I installed it few days ago with the fabulous Blog Profile module (thanks Ryan). And now I want to add widget in my sidebar. I have searched on forum, in videos or tutorial, but I think I don't have made a good search. I try myself but it doesn't work So if someone would help me or send me some greats links, I think it will be top Thanks a lot everyone and to finish I'm proud to join your community ! Elkolonel.
  22. Hi there, I've got two templates that need some of the same fields. So, is it possible to get a field value from another template? So when I update on one template, I update on all other fetching this field? Thanks
  23. Hello there, I have a template only to get a simple structure in my page tree. (for example: a category-site) the sites from this template must be hidden... if they are not hidden, you can see them in my nav-menu! Now - my question: Is there any way to set a permanent hidden-state to the template? Why I need this: ...because there are some admin-noobs... I think they will forget to set the page hidden. Thanks a lot. Stefan
  24. I am building my first website with processwire, but of course I am starting with a relatively complex site for an entertainment booking agency. Before I spin my wheels for several days or weeks, I am seeking advice on the best approach to create a dynamic xml file that will contain file paths for different sized jpg files for images, mp3 and ogg files for audio, and mp4, webm and ogv files for video to play natively in various browsers within responsive pages that will adapt to the device on which they are displayed. Most of my experience is with Dreamweaver, and I know how to do this with static pages because there would be a unique xml file for each static page. However, creating a static page for each artist on a roster of 200 that is growing monthly is not practical. I've looked at several content management systems and have concluded that I want to invest my time in the one I consider the best--processwire. So here I am asking for help. I note that something similar has been done with the module Local Audio Files-MP3-DB by horst, but I'm not sure that is the best approach here because I will likely have an average of only 20 jpg files and 5 of each of the other file formats for each performing artist on this website. The key is that I must create a unique xml file for each of at least 200 artists that will reference their unique works. I would appreciate any suggestions either on what to try or what not to try so that I can avoid wasting time on "blind paths". If it helps to visualize my objective, you can view a template of an artist's page at http://www.book-entertainer.com/rob-garrett/. I know all of your time is valuable, but I am just not sure where to start. Thank you. Bill
  25. Hi Has anyone ever tried to create a YUI 3 template as a starting point or would it be a waste of time? I have searched forums with built-in search and google and found nothing of relevance.
×
×
  • Create New...