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 I have just started with PW and after struggling to get a test site on my hosting platform. PHP 5.2.17 mysql 5.0.96. Problem with .htaccess and follow symbolic links which I have sorted out (commented out) Default page and admin loaded OK. I then uploaded Foundation files flushed site (?flush=1) Problem can be see at http://new.stpiusx.za.org/ Same problem in Chrome & Firefox I have done similar installation on local server (PHP 5.3.10 mysql 5.5.32) all worked OK Any thoughts would be appreciated not sure were to look? System seems very fast Allan
  2. Hi, I'm following this tutorial on Windows using XAMPP 1.8.3 and ProcessWire 2.3. Well, "following" means that I am stuck in step 2. There are two folders in the root directory of the website (htdocs), "site-default" and "wire". I created "planet.php" in "site-default/templates" and "site/templates". But when I click "Add New Template" in the admin interface, it says "No new template files were found in: /site/templates/*.php". I'm sure this is a typical newbie thing and I'm really sorry for asking but: what am I missing? Where do I create new templates? Thanks in advance! Hendrik
  3. Hello everyone, I'm currently trying to find the best way to solve a problem and I'm not really sure, whether there's an easy solution. Consider this example: 1. There is a template for "author", "article" and "tag". 2. The "article" template has a) a pages field for authors on or multiple authors and b) a pages field for on or mutilple authors tags 3. On the "authors" page I want to display a list of all tags, for which this author has articles. The naive approach would be to just get ALL tags, iterate through them, check if there's a page with the given author and this tag and if yes, add them to the list of display tags. Something like this: $authorTags = new PageArray(); $allTags = $pages->find('template=tag'); foreach ($allTags as $tag) { if($pages->count("template=article, tags=$tag")) { $authorTags->add($tag); } } While this works great, there's obviously a big performance problem: it doesn't scale since each additional tag results in one additional query. The cache will have to be cleared on changes of each article, which could happen pretty often, so this is not a solution. My second approach was to have an additonal field for tag in the "author" template and write a module that hooks into page save of "article" pages, checking for changes in the tags field and replicating them in the given author's pages. In the "author" template you can then just display your tags as a "native" field, which shoud be simple and performant. While I think, that this will probably the best and most clean solution, it will also be a lot of work, so I was wondering whether anyone of you maybe knows a) an easier (while still performant) way to archieve this, or b) a finished module that already solves this problem or is at least a good starting point to solve it. Thanks a lot for your answers already, Marc
  4. The 'global' flag for field is great, untill you don't need that field anymore and you have over 30 templates that have that field assigned... It looks like you have to manually edit every template and delete the field from there, save, then check the checkbox to confirm? Is there a way to do this faster? Thanks.
  5. Hi there, I'm currently writing a module that needs a Process action to generate some previewable HTML+CSS Code. In my code I'm doing something that boild itself down to this, to generate the preview: public function executePreview() { $p = new Page(); $p->template = $this->get('template'); // configurable module variable return $p->render(); } Would be fine if this wouldn't render inside the default admin template (that I need for other actions of the same controller). This inserts a lot of CSS and JS that I can't use here. The Preview action will be embedded into another action as an iFrame and I already tried calling it with ?modal=1 which get's rid of header, footer and sidebar, but still loads the CSS and JS. What I'd like to do know is to programmatically change the template of this view, but I wasn't quite successful. I inserted this in the above code to make it render another inside my module folder, but it still renders inside the default admin template: $this->page->template->set('filename', $this->config->paths->MyModule . 'my-blank-template.php'); While this would be pretty hackish, it also doesn't work... but I really hope that someone of you has a better answer to this problem? With kind regards, Marc Edit: While stepping through the code I wondered, where exactly the $page->render() function is?
  6. Let's say I have a page that I don't really need a template per-se. It's a one time page with no fields. Maybe it's a page with a form on it, or a big 3rd party iframe, or an htm image map (remember those?). Do you just use a basic page and then put an if/else statement in basic-page.php? If($page->id == 1003){ <iframe .../> }else{ //render content as normal ... } Or are there other strategies for dealing with these edge cases?
  7. Hi Guys I'm doing the unthinkable and attempting to recreate cmscritic.com with processwire. A task that I'm sure will be incredibly fulfilling once complete and I'm hoping will teach me how to use this CMS in the process. (pun not intended). I'm messing with the blog profile at the moment and when I look at the template, I see it's got a field "site title" which when viewing the page, is populated with the words "Basic Blog Profile" and used in the masthead. Since I want to use an image logo instead and have it easy to change within the backend, I added an image field to the template and uploaded my logo. The issue i'm having is that I'm unsure as to how to call this and within which template. I can see it in the page now as an uploaded image but I don't know how to call it within the masthead. Tough to explain, hopefully my question makes sense. Here's a screenie to show what I mean. Thanks in advance! Mike
  8. Hi, Just started using PW and really love it. I've started to create my own template and was hoping I could get some advice on how best to go about my project. I've created a one page website which uses HTML, CSS and Javascript and want to convert this over for use with PW. The concept is fairly straightforward, it's a series of module blocks of HTML which I can move to alter my layout. Here's an example of the structure: Header Page1 Module1 Module2 Module3 Page2 Module1 Module2 Module3 Footer Page 1 and 2 are essentially <div> containers and each module is also contained in it's own <div>. My understanding of PW is the code for each module I've created would get wrapped into various custom Template Files which could then be positioned as required within the page Template. Is this correct? I plan to use this layout for multiple sites so I also wanted to know if it was possible to create the module blocks in such a way that they could easily be installed/ported across to another site? Any advice or links to creating this setup would be greatly appreciated.
  9. Hello, I discovered processwire a couple of days ago and I am very impressed so now I am integrating it with the Yii framework (once complete I'll post a tutorial with code), so far it is going well but I do seem to have a problem with setting a new path for a $page->template->filename. Setting $config->paths->templates in the PW config.php file works fine but I want to be able to set Yii-specific config variables after I have included the PW index.php. I assumed that by setting $wire->config->paths->templates that this would be reflected in $page->template->filename but that doesn't seem to be the case. Is this a bug or am I confused? Any advice greatly appreciated.
  10. Hello again everyone, I'm creating a template with an easy-to-use front-end adminbar (basically says: "Edit Page", "New Page", "Add News", "Add Product") and to make it more "user-friendly" it has the editor avatar and name as well as the options for "Profile, Help and Logout". I wanted to use PW's Comments Fieldtype and found that it's possible to display comment count here: http://processwire.c...rns-odd-number/ and I also found that it's possible to check comments since the last visit here: http://processwire.c...nce-last-visit/ I am now wondering *if* it's possible to display the total comment *count* from all pages containing the 'comments' field. Basically like this: "Welcome Back admin, there are {$comment-count} new comments." and that would redirect to the Comments Manager module. I've looked around the forum but didn't find anything similar, and I'm not really good with PHP so I might've overlooked a function. Thanks in advance. EDIT: Can I use something like: $count = count($comment) ?
  11. Hi all, I know that every template has its file associated for rendering the page. But i wonder if i can change file in a page that require a different visualization without create another template. Is that possbile ? ADB
  12. Hi, I'm trying to build my own install file to be able to start every new PW install with a fixed number of fields, So far I've dumped my previous PW database into a .SQL file and included it in the install.sql, during the install it nicely imports all my database settings into my newly installed database but I do have a problem with the admin user, when I try to login I get a any ideas how I can fix this or copy a database into a new install profile?
  13. Is it possible to replicate a field in a template? Let me give an example. 1) I create a field named "article" (textarea multi language) 2) I insert the field "article" in a new template "page news" 3) I create a new page with the template "page news" 4) I enter my body, title, and ... 5) I want to put 3 fields "article", another page in 5 fields "articles", in another 20 fields "article" and so on ... using the same template. there is a method? FIND NOW -> http://processwire.com/api/fieldtypes/repeaters/ Thank u...
  14. So we have a project setup that has added a module that uses the addHookAfter('save') functionality. Essentially the goal is after a we actually "Save" the page options in the backend of PW we grab specific fields we have created and do an API call to an email service which includes doing a $page->render() to grab the full html for the page we are editing and send that along as the body of that email. The issue I am seeing when I actually view the page via the browser there are images that are showing correctly from a loop of articles but when I do the render I am only getting the path to the image like for example if the image url is: /site/assets/files/2123/feature_car.jpg I am only getting via the $page->render() instead of the full path: /site/assets/files/2123/ The section that this is happening is running a loop on articles inside of the template file and is causing the error is similar to this. The problem is happening with this part of the code: <?php echo base_url().$a->featured_image->url; ?> Heres the overall code: <?php $related_articles = $pages->get(1007)->children("template=article,is_national=1,related_edition={$pages->get(1021)->related_edition},related_categories!={$pages->get(1132)},sort=-date,include=all"); if ($related_articles->count()) { foreach ($related_articles as $a) { ?> <table cellpadding="0" cellspacing="0" width="100%"> <tr> <td> <a href="<?php echo base_url().$a->url; ?>" title="Learn More: <?php echo $a->title; ?>" target="_blank"><?php echo ($a->headline != '') ? $a->getUnformatted("headline") : $a->title; ?></a> <?php $suffix = ' <a href="'.base_url().$a->url.'" target="_blank" style="text-decoration: none;" title="Learn More: '.$a->get->title.'">Learn More »</a>'; if ($a->featured_image) { ?> <table cellpadding="0" cellspacing="0" border="0" width="100%" style="margin-bottom: 10px;"> <tr> <td> <?php if ($a->featured_image->url->description != '') { ?> <a href="<?php echo $a->featured_image->url->description; ?>" title="<?php echo $a->get('headline|title'); ?>"><img src="<?php echo base_url().$a->featured_image->url; ?>" alt="<?php echo $a->get('headline|title'); ?>" border="0" /></a> <?php } else { ?> <img src="<?php echo base_url().$a->featured_image->url; ?>" alt="<?php echo $a->get('headline|title'); ?>" border="0" /> <?php } ?> </td> <td valign="top"><p style="font-family: Arial, sans-serif; font-size: 13px; color: #555555; line-height: 16px; margin-top: 0; margin-bottom: 10px;"><?php echo (trim($a->summary)) ? $a->summary.$suffix : truncate($a->body, 250, '..'.$suffix); ?></p></td> </tr> </table> <?php } else { ?> <p style="font-family: Arial, sans-serif; font-size: 13px; color: #555555; line-height: 16px; margin-top: 0; margin-bottom: 10px;"><?php echo (trim($a->summary)) ? $a->summary.$suffix : truncate($a->body, 250, '..'.$suffix); ?></p> <?php } ?> </td> </tr> </table> <?php } } ?>
  15. Hi all, I was thinking what's the best approach for a multi-themed website. The point of this is to build a website that has a simple website for mobile within a subdomain (m.domain.com, for example). How can this be achieved? I assume everything would be easy if there would be another "/site" folder. Is this it? If so, how can that be achieved? Many thanks in advance! Cheers
  16. Hi all I am very new to ProcessWire, but have managed to create a content managed site in super quick time! I currently have 2 templates, home and content - that's all I've needed! But now I need to add a new column on the right of my pages that will hold a list of PDF downloads. The list of downloads will be different on each page - some will have a few, some will have none. Each item in the list needs a name, thumbnail image, and document to link to. I was tempted to create a new template for each, but I don't think that's the way to go. Would I do this like a list of news articles? But then I don't know how to specify which 'articles' appear on which page? Any pointers would be greatly appreciated!
  17. Hi guys.. I was wondering.. How do I render or output simpel <input> markup?? The list output that InputfieldForm makes is tomutch.. Im loading a template (without file) and I want to output the same fields as a form in the frontend.. Thanks for all your work...
  18. hello forum, i've read somewhere in the docs that the use of template tags was given up with the switch from version 1 to 2. does that mean this code <li><a$class href='{$child->url}'>{$child->title}</a></li> as found in the head.inc with the official download is no longer valid? Or is the use of curly brackets a regular use of PHP (I'm very new to PHP unfortunately)? Wouldn't you rather write <?php echo $child->url ?> instead of {$child->url} ?? thanks, christoph
  19. Hi all.. I was wondering, Is there a nice css/template framework out there? I have been playing around with Twitters Bootstrap, but It has its limitations.. Let me hear your 2 cents..
  20. Looking in to PW as an alternative to Drupal. Just wondering if there is any way to define the template file on render. I read in another post about setting a variable before render and checking for that in the template. ($useThumb, was the example to render a thumbnail) But I wanted to keep my templates clean and create, for example a teaser.php template file. Inside of that I would use something like a switch($page->template) statement on $page->template to write out the html for the corresponding type. For example, say I have a video, blog and image type. I could simply have them all use the teaser template file on the homepage. So the real question is, can I switch the page template dynamically and will I be able to access the "original" template in the new template. Here is a code sample to demonstrate: // home.php $videos = $pages->find("parent=/video, featured=1, limit=3, sort=-date"); echo "<h2>Featured Videos</h2>"; foreach($videos as $video) { //set teaser template $video->render();/* Want to render using the teaser.php template */ } // REPEAT for blog and image, all use sample template // teaser.php switch($page->template) { case "video": echo '<div class="teaser video"><div class="field-video">{$page->video}</div></div>'; case "blog": echo ' <div class="teaser-blog"> <div class="title">{$page->title}</div> <div class="date">{$page->date}</div> <div class="summary">{$page->summary}</div> </div> '; break; }
  21. I've been working on a medium-to-large scale project using pw (browsable alumni works and news repository, for a multimedia design school). I assume this kind of project is just what PW was written for: loads of information that can be cross-searched, etc.. And for it to work smoothly, sharing fields is the way to go, of course (do correct me if I'm wrong..) The "problem": some fields acquire diferent roles in different templates ("title" can be a Title or a student name on a student Template), and may benefit from independent descriptions (for setting protocols - specially important on a repository) Multiple field descriptions would be awesome (specific to each template), but I imagine the work that such a change could mean may not be worth it... I haven't explored the DB very deeply, but I assume the description is in a field entry, and would have to be in the field-to-template entry... Or maybe I'm reading it all wrong Any thoughs? Am I completely off the ball park?
  22. It's common sense to name things based on meaning -- search, sitemap, home, basic-page / default etc. -- but I'm interested in hearing if you folks are defining / following more specific rules than these. This is something I've been thinking quite a bit lately and unfortunately I feel a bit lost here. IMHO this becomes an important thing especially when you have multiple developers working on / providing support for same projects, which they aren't necessary familiar with. It's one of those things that make it easier for a new developer to jump on board of a project and instantly understand what's happening under the hood (or at least make educated guesses.) So after this (longish) explanation, I'd really love to hear what you think about this subject -- what kind of naming conventions do you apply for your templates and/or fields? (If any.)
  23. Hi, I am a newbie to programming and I am developing this site for a client of mine(WIP) : http://greenpantry.in/test820fcec/ It is a single page site, where the content is divided into sections. I want to know if it would be feasible to use Processwire to manage the content of the site. From what I have read, processwire's templating system is based on pages. I want to know if the client will be able to edit each section individually from the admin panel, as I feel creating a single long template for the page will be kind of messy. 'our platters' and 'gallery' are the two sections they want to be able to update. Btw PW looks so fresh and this is probably a trivial thing to execute. I just wanted to be sure it was possible before i dive in. If this is possible, any pointers as to where I can start will also be very helpful as I am just now beginning to go through the docs/videos. Thank you!
  24. I am wandering to find out if it is easy something like: "..., sort=template, ..." or "..., sort=template.name, ..." for sorting the pages by their template name in selectors result. When it will be useful: 1. My clients were asking to display the professors first, then doctors, then students in the paginated staff list. 2. Other clients requested to display products pages first in the site search results. I know I could use two search selectors and to concatenate their PageArrays but it will be more complicated with the pagination. I could use a dropdown with "search in products", "search in site" too.
  25. How do I go about adding the process field to a new template? I created a new template and placed it under the admin page (I also set it to use the admin template) - however, I don't see the "process" field as an option to be added to it. Thanks in advance for any pointers! Edit: To clarify, I assigned "admin" as the alternative template filename for this new template because I need to add other fields to it.
×
×
  • Create New...