Jump to content

Search the Community

Showing results for tags 'Templates'.

  • 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've abstracted all of my templating to the point that the files at /site/templates/[template_name].php are completely empty. Is there any way to get rid of the need for the empty template file and still have processwire's built-in routing work as expected? Thanks! Jason
  2. Hello, I've tried to search the forum for this but so far no luck so I decided to post this in wishlist section. Under the Templates/Permissions, there is an option to redirect the user to a certain URL when he is not permitted to view the page. However, this is a pure text input and it's really difficult in the case where I would like to choose to redirect user to a certain page. The page might have multiple URL (multiple languages) or the url might be changed later by the user so a static URL redirection here is no good. Have a nice day.
  3. I just noticed that the added items in/under "Add New" are sorted by their template-name. As you can see, on the screenshot below, these "names" differ sometimes to their "labels". Kategorie => category Artikel => post Schlagwort => tag For such kind of cases, it would reallynice if we could sort them manually. That we can sort them by their labels or what ever... Artikel => post Kategorie => category Schlagwort => tag As surprising pw is, this is already possible, somehow?
  4. I only stumbled across WP a few weeks ago, but have already been able to accomplish far more than over months spent banging my head against the baroque code of several shall-remain-nameless frameworks. I could weep thinking of how much time I have wasted elsewhere. I have, however, hit a speed bump--possibly due to the fact that I am still a bit shaky on how templates interact. My set-up (a sample travel site): Places Place1 see poi1 poi2 do poi3 poi4 sleep poi5 plan poi6 Place2 see poi7 do... Interests Interest1 Interest2 Interest3... "Interests” act a bit like tags assigned to the "poi"s (this is an internal tagging system, open to admin only; no free tags/users cannot assign). For the record, that odd "poi" nomenclature stands for "point of interest" (as a unique name, it's handier than using something vague like "item"). (Aside: Yes, I realize "see, do, etc." could exist instead as a third "Categories" tree. I fiddled with that, but in the end figured I'd just use the already powerful and straightforward parent/child nesting format of pages that PW provides. Also [ahem], I couldn’t get urlSegments to work; another time.) A simple foreach loop on my _main.php page creates a link-list of the Interests assigned to a given poi. <?php foreach ($page->interests as $i) { echo "<li><a href='{$i->url}'>{$i->title}</a></li>"; } ?> When you click on these generated links, it takes you to the appropriate "Interest" page, populated by all POIs assigned that Interest. Here is the relevant part of my Interest.php code: $int = $page->id; $pois = $pages->find("template=poi, interests=$int"); $content .= renderNav($pois); Problem: I do not want to see _all_ the POIs assigned that Interest. I need to limit it to other POIs in this particular Place (the grandparent of the referring POI). In other words, I only want to see other "Museums" (interest) in London, not those in Bath, Manchester, and Oxford as well. This is easy to do in absolute terms (I can limit to "has_parent=London" or something); but I need it to be some kind of $place variable instead, one assigned by the referring POI. For the life of me, I cannot figure out what code to use and where to stick it--in the foreach loop of the poi.php page? On the "Interests" template page? In short, how does this variable (the "Place" grandparent of a given POI) get assigned to the link and hence carry over to be able to be used in the functions being applied by another template (Interests)? I suspect the answer is so glaringly obvious only an interactivity noob like me would not know. That would explain why I canot seem to find the answer after a solid week of trolling every forum thread, tutorial, and wiki at PW. While I’ve built my own static HTML sites for 20 years (wow, that seems long; anyone else remember dividing text blocks with HRs, or the glorious day HTML3 finally allowed us to align GIFs so text could actually flow around them?) I am only a journeyman at PHP and MySQL. I've never even created a form. I know. Shameful. Thanks for your help.
  5. I've started a processwire project from a blank project. for some reason when I open my browser the page opened is not the "home.php" page, but the "basic-page.php" template. I've checked and my home page is set to use the 'home' template and not the 'basic-page' template. How do I change that?
  6. In this post we had a small discussion about making PW more userfriendly(for new, non developer users) https://processwire.com/talk/topic/7184-lets-highlight-processwires-ability-to-be-an-enterprise-cms/page-2 Personally i think the technical details belong to another thread, so i opened one. When you install PW you got basic pages and nothing else at least from the view of a newcomer that is not a developer. What does a newcomer expect from something that is propagated as being better than WP? Basic pages whith more than body and titl. At least they need title, browser title, meta description, publish date controll, a main image, image uploadfield for images in the MCE editor, short text, long text(Tiny MCE), tags, optinally a small gallery for additional images(whith lightbox), an easy option for comments. A basic Blog/News system as news and blog can easily be used interchangeably. Image cropping on default image fields. Premade RSS feed. Premade sitemap. Premade search. A basic form module An Image gallery with mass upload, description,title, title tag, alt tag, fancybox option. A Template system for easy template change and an option for modules to link in Module installers that are able to deinstall a module completely.(for example the blog module does not) Site settings and maybe Template settings Simply install and go. The interesting part is that almost everything from this list is already there in PW. A few words about PW in general. Im my opinion PW is not a CMS, at least not now. Its a CMF whith an extra comfortable backend , and it really schould be advertised as that right now. Many of the stuff that pepole expect from a CMS is not present (installable templates, modules, calenders...) it has to be build by yourself. Even if thats pretty easy to do, its not click install and go. So its a framework and not a CMS. Ok, let's look at the reality of most CMS. Either they got far to many modules or they do not have enough modules. Many modules are unmaintained or broken or lack some important functionality. Often installation of any module or updating the CMS breaks a lot of things. even paid modules often come whith lots of problems inside plus you literally have to test hundreds of modules before you find a combination that is functional, compatible and affordable. So from this point of view PW is even better than any CMS, as almost all stuff is build with plain core functionality, but still its a framework not easy to understand by a user. So what do we need to make it a CMS? The keyword is standarisation. An user does not want 100 ways to make a news page, he exactly wants 1 way to do that. Its great if you easily add some fields but basically he just wants a news page. Standarisation does not need to take away freedom, it only allows to make components that interact in certain defined ways. Standarisation can never be perfect but it can help alot in interaction between different parts. If we look at PW templates there are endless ways to get the result you want so its almost impossible to make a module that creates at least a halfway decent looking default template for its functionality that links into the basic site structure. Would it be bad to create a standrard way for making templates that allows modules to link in ? Would it be bat to have a bunch of default modules that allow templatebuilders to produce templates that already have a well made formating at least for this few modules. You still have the option to do it the way you like, you can build your own stuff or just modify the existing stuff but in addition to that you now got the option of installing a few modules, buy a template, do a few modifications and you page is ready. So it even adds more freedom to the system not less. Lets take a look at WP. Most templates only support the basic blog and maybe a few modules. as soon as you start to install additional modules you either have to live whith an often ugly default output and often it fails completely. So you start modifying the template or even worse you need to modify the module. The next module update kills all your changes and you have to start over.... The fun starts if you have a bunch of modules that need modification . A big company called Templatemonster has a solution for that problem. They sell WP themes that are a complete installation bundled with all the necessary modules and all addons fully functional, but don't try to upgrade the WP system, simply don't do this. Maybe this is the perfect way for PW to make premade templates ? I guess not. You still run into trouble if you want to change the look of your page. But still it may be an idea to earn some money whith PW. at least i would pay for a nice installation package whith blog and gallery and a really nice modern template with some color, background and logo control in the backend. For the easy creation o something like that we would need an extended Profile Module that allows to store a complete page as an installlable Profile. Right now i had some trouble storing multilanguage support and pre generated user and a few other things. So i guess the best way would be to define a bunch of standard modules, define a default way to do templating and for interaction between modules and templates. More about that tomorrow(more technical details ), i need a bed right now
  7. I'm trying to hide some of the pages on my website from users that are not logged in. I'm trying to achieve this by changing the settings of the page's template like so: This hides the page from my navigation which is good, but it doesn't block the user from surfing to the page directly which I think should be happening if I interpret the settings correctly? When I first encountered this issue I was running PW 2.6 but I've since updated to 2.6.8 alas to no avail. I hope someone will be able to help me out and I will be happy to provide more information about this issue if need be. I'm currently working around this issue by adding a $user->isLoggedin() include to my pages but this isn't as clean as setting the permissions directly from the CMS imo.
  8. After creating fields and assigning to a template, I added pages with the template. All good. At one point, I had an admin edit page open to view the data and the template configuration in another browser tab to check the field names as I was coding the layout offline. I edited the page and submitted. I then viewed the front end page in another browser tab which showed nothing? Went back to the template config tab and refreshed it. All 35 x fields, including the title field were dropped from the template!!! I checked in phpMyAdmin and my custom fields were all there with, eg land_measurement: {"inputfieldClass":"InputfieldSelect","tags":"property","collapsed":0,"send_templates":[41],"showIf":"land_area!=''","columnWidth":80} where [41] matched my template id. Everything else in the template configuration was correct. What happened to the field assignments in the template? How can I recover them without having to reconstruct the template? More importantly, what caused this behaviour so I can avoid it in the future? Using: PW 2.6.1 Apache version 2.2.29 PHP version 5.4.40 MySQL version 5.5.42-37.1-log PS: I also had a template lose its fields on another site running an earlier PW version on a different host. Any ideas? TIA
  9. 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
  10. Hello! I often have to change image sizes in templates using the ->width() or size functions and on a image heavy site this a cause timeout errors or massie lag before all the images are resized when changing to the new template. I was wondering if there was a good way of creating these images without having to hit each page on the site for the template to be called and images updated? Basically to avoid the errors? Thanks
  11. Hi, I wanted to know if Processwire allows for Sub-Templates? Example would be if I have a content heavy template, i'd be able to showcase content on various sub-templates of that page. So mysite.com/bio would be the main page, and if I wanted to a specific piece of content on a page by itself, I'd have a sub-template with mysite.com/bio/location Hopefully that makes sense. Thanks!
  12. Hi all. I have pages (templates) that are only accessible to certain users. Now I need to get all users that have view access to specific pages (they will get email when page updates). I thought of something like this: $template = wire('templates')->get($p->template); $roles = $template->getRoles(); $users = wire('pages')->find('template=user, roles=' . $roles); But it looks like getRoles() doesn't returns the roles for that template. Roles is an empty PageArray. What is wrong or is there another way to get those users?
  13. Is there a somewhat comprehensive guide or tutorial somewhere on theming the PW admin? There's so much untapped potential there I just don't know really where to start to learn my way around it. If not, would anyone care to create one? I know I would greatly appreciate it, as would many more users. There are no admin themes in the modules directory currently that claim to be compatible with 2.5. That would probably change with a solid beginner's guide.
  14. Hi! I am building a site where there is another user-template as introduced in 2.5.14. (http://processwire.com/blog/posts/processwire-core-updates-2.5.14/#multiple-templates-or-parents-for-users) For now, you have to add the parents of the users with the new user-template manually like so: $config->usersPageIDs = array(29, 1026, 1027); But I have dynamically growing pages which hold the new users, like so: Home Members Group User User Group User User ... ... Ryan mentioned they're working on automating that process, but I wonder how I could accomplish this now. Naively I tried to fetch the parents like so, directly in config.php: (I'm quite novice ) $those_pages = $pages->find("template=that_template"); But that failed - nothing got rendered. Then, I thought I could do that in the site template files. But that would be too late, I guess? Also this approach would be useless for the backend... and I guess I don't need this configuration for the fronted anyway!? Now I wonder where would be the right hook to some function in the right time to accomplish this? Or any other solution? Hope you get what I mean ...
  15. The first time you create a field, there is an info tab which says This field is not currently in use by any templates. It would be real time saving at that point to select the Templates which can use the new field. Otherwise we have to save the field ... browse to Templates ... find your template ...click it and add and reorder it there.
  16. I'm working with a PW 2.5.3 install. Here http://processwire.com/blog/posts/processwire-core-updates-2.5.14/ there is a quick tutorial on setting up an alternate user template and parent. I followed it to the T, but it didn't work; when adding a new user, there was no choice of template, and once the user was created the alternate template I had set wasn't even among the select options. Has anyone managed to do this or even just an alternate template successfully? The alt. tpl. is what I rly. need... I just tried it twice over and then erased and undid everything 2x too, so... Then I only unchecked "Don't allow pages to change their template?", cloned user template (id=75), added "$config->userTemplateIDs = array(3, 75);" to config.php created a new user No alternate template option still. This should be able to work right? Because I don't see a date for that blog post but do only see comments from 5 days ago, but it says 2.5.13, I'm using 2.5.3.
  17. I want to give Twig a try for creating template pages. How do i start ? Use TemplateTwigReplace or TemplateEngineFactory (with TemplateEngineTwig) ? My main concern is to be able to use the AOIM in my templates. Do I have to use TemplateDataProviders as well ? Any guidance is welcome. Thanks
  18. Hello. I'd like to clarify something that's in the back of my mind for a while. If i have 10 fields with the same parameters, except only the labels, for example scatered in different templates, i must have 10 different copies of those unique fields?
  19. Hey guys, Was just interested in your different techniques for sending HTML emails through your templates. More specifically, where you store your email codes? In the past, using smaller, simpler emails I was "OKish" with keeping all the HTML garbled in my form processing at the top of a page but am thinking there must be better ways surely? Do you use includes? ProcessWire templates? Just interested in seeing your different techniques.
  20. 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!
  21. When creating or adding a new template I'd like a short template description field. That template description should then also be visible when choosing a template for a page. If you've a lot of templates, it gives editors some asseurance that the template they are selecting is the correct one.
  22. Hi, I was reading a very interesting post in this forum (https://processwire.com/talk/topic/7166-wp-tavern-article-and-processwire-themes/page-4), about PW and its popularity compared to other cms like Wordpress. The key point that has been discussing is: how can PW be more attractive to non developers (ie designers)? (ok here another question arises "Do we want that PW reach an audience bigger that developers only?" but this is another topic...) Wordpress for example has a theming system that certainly is very attractive and quite easy to use, and I noticed someone in the community is already working on a module that could do some steps in that direction. That could be great but there's another thing that in my opinion could help very much: an automatic template file generator. Let me explain... I think that one of the things that scares a person which is not a developer the first time he uses PW, is the fact that after creating some fields and a template that contains these fields from the administration panel, he has to create a new empty file named as the template and put it inside the templates folder. Obviously from a developer point of view this is not a big problem, I go searching the docs and try to find what to put in this file, but from the point of view of a person that has no the developer mental scheme that thing could be scary at the beginning, and I imagine that if this person is trying out a lot of cms to find out which is better for him, he could easily think "ah dawn this is too complicated for me!". Ok, so what if I can, after creating a template, press a button and let the system create the template files for me? This could be great! I can now go to PW tree page, add a page with the template I created before and when I navigate the site I have already a page that is working, and it also outputs the fields that I filled! Then, I go editing the template file that has been created automatically and change the html as I prefer, but I don't have to bother about php code at all... The next step is thinking about a small wizard that create the file when I press the generator button: for example I have to choose if I am creating a simple detail template or a list template. In case of the list maybe we need the user to enter some filter parameters to generate the array list (template type, parent, etc.) and so on... So, this is not a trivial task but maybe not even impossible. In the future you can also think about a way to make this module useful even for developers, for example creating some template for outputting the html of the template files.... But maybe I am going too far So basically I think it could be very interesting to create a module that adds this functionality to PW... What do you think?
  23. Hi all, I am quite new to PW, and I am starting to create my first modules. In a site I am working on, I have already created some templates, fields and pages to manage a simple event management, with event list page, event detail page, list of categories, and so on. Now I would like to put all this inside a module, so when I start a new site all I have to do is install the module and I am ready to work with the events. I already understood how to create the module and do the installation (and uninstallation of course) of templates, fields and pages, but now I am wondering what's the best way to manage the template files (.php) that the module pages will use. I noticed others have chosen to copy the needed templates files inside the "site/templates" directory during the installation of the module... Do you think this is the best approach? Are there any alternatives? I am not fully convinced since this way I am adding new files to "site/templates" folder and since this folder could already contain a lot of files the situation could become a litte messy (since I have a mix of files I created and files that a module created). If this is the right way to do it, I am wondering if in PW there is a way to use subfolders inside the "site/templates" folder, I am thinking for example to have a subfolder named as the module name, so all templates .php files related to that module could stay here, in a more organized way. Thank you for a feedback on this! enrico
  24. Hi there, Is there a way to get: foreach($templates as $template){ $options.= "<li>{$template->name}</li>"; } to work for a selectbox inside "getModuleConfigInputfields"? i am implementing a module which hooks after page->save. i need the Values (Parent Template, Child Template, Child number, Child name) to be set. I would rather do this with a selectbox of all Templates then with a Textfield. idea behind this is that a customer should be able create a page and gets always the same amount of children inside the page, which should be configurable on the module, because i need this similar tool already 3 times. thanks for every help
  25. Hi altogether, since I am currently working on a project that has (hopefully) the potential to reach a certain level of complexity at some point, I wanted to start the template structure in a scalable and "proper" way. In the following I'll try to give a summary about the approach I'm testing: 1. Directory structure inside site/templates/ /controllers/ /views/ 2. Create init file named... site/templates/init.php...containing (for example): <?php function getPartial($name, $allpages) { // Site wide $settings = $allpages->get('/meta/settings'); $root = $allpages->get('/'); // User related $loggedInUser = wire('user')->isLoggedin(); // Page related $title = wire('page')->title; $children = wire('page')->children; $template = wire('page')->template; include($config->urls->templates . 'controllers/' . $name . '.php'); include($config->urls->templates . 'views/' . $name . '.php'); } 3. Uncommenting prepandTemplatefile in /site/config $config->prependTemplateFile = 'init.php'; 4. Creation of partial (controller and view) in their respective folders /site/templates/controllers/test-partial.php /site/templates/views/test-partial.php Example controller: <?php $homepagetitle = $root->title; Example view: <h1><?= $homepagetitle ?></h1> <p><?= $title ?></p> 5. Creation of layout file. I tried to put these in a folder called /layouts, but that does results in PW not finding new templates anymore in the PW Admin when creating a new templates. Any ideas? Changing index.php's $config->urls->templates ? Example layout: <html> <head> <title>Foo</title> </head> <body> <?php getPartial('test-partial', $pages); ?> </body> </html> So, for some reason I have to explicitly inject $pages or wire('pages') into getPartial() - but I have no idea why, since $page or wire('page') is working without problems in the functions scope. But: The output is just as intended. The title of the root page in a h1 headline, and the title of the page using this "layout" in a paragraph. Any feedback or pointing to pitfalls of this approach would be highly appreciated Best, marcus edit: Funny, essentially this is a very stripped down way of Template Data Providers, which needed Twig the last time I tried to use it.
×
×
  • Create New...