Jump to content

Search the Community

Showing results for tags 'SOLVED'.

  • 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 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!
  2. Shouldn't a module add a .css or .js named same as the module automaticly? It strikes me again, that I added a ModuleName.css to the module folder assuming it get's added automaticly, but it does not. Not first time I struggle with something that should be simple. Edit: The module is autoload and is extends WireData implements Module. (of course in the admin, not frontend. In case anyone wondering)
  3. Hello! Just discovered PW a few days ago and I think it's an amazing CMS. TRying to get my head arround the plugins/ modules and I was wondering if anyone can explain me how to use the Wire Tabs plugin. I want to have tabed content in one of my templates, 3 tabs to more specific, each tab containing textarea fields. I managed to create the fields, but I need help to display it in tabs. Will it be possible to have the same fields displayed in tabs in the admin, for editing also? Thanks in advance! Norboo //Edit: adamkiss Moved from 'Modules & Plugins' forum, because this more of a General support thing
  4. How could i accomplish this? I would like to have in the admin a second page navigation and I would like to able to move some elements from the default page navigation to the other one. The element and their children. Any ideas on this?
  5. Hi, Is there a way to specify the default Page which appears upon login, either by role or user? I've made a custom admin Page I'd like to appear instead of Pages. Probably am overlooking something simple... Thanks! -evan
  6. Hi guys, have been having an issue with pagination. It's a bit odd, I have it working fine as per Ryan's docs but when I get to a page2 of results, my categories don't display. I should add that my categories are generated at the top of the page in their own loop. The template also uses urlSegment to filter the results by category. I have added pagination to both the news template and also the categories template which get's called through urlSegment. On the main news page, pagination works but the categories come up empty when on the 2nd page. On the categories template, the pagination won't show at all, and I'm not sure why as it's pretty much an identical setup to the news template. Here's all the code, in case any of you can make sense of it.... Thanks. News index : <?php include("./header.inc"); ?> <div id="news_index" class="grey_gradient"> <?php if ($input->urlSegment1 !="") { include ("./categories.php"); } else { ?> <div id="news_top_bar"> <h5 id="news_header">Recent news items</h5> <?php $news_cats = $pages->find("template=news_category"); if ($news_cats) { ?> <ul id="news_cats"> <li>By category: </li> <?php foreach ($news_cats as $cat) { $numArticles = $pages->count("template=news_entry, news_category_link=$cat"); if ($numArticles > 0) { ?> <li><a href="<?php echo $page->url . $cat->name; ?>"><?php echo $cat->title; ?></a> / </li> <?php } ?> <?php } ?> </ul> <?php } ?> <div class="clear"></div><!-- /.clear --> </div><!-- /#news_top_bar --> <?php $news = $page->children("sort=-created, limit=3"); foreach ($news as $entry) { $class = "news_box"; if ($entry == $news->last()) { $class .= " news_box_last"; } ?> <div class="<?php echo $class; ?>"> <div class="news_index_text"> <h3><a href="<?php echo $entry->url; ?>"><?php echo $entry->title; ?></a></h3> <h6><?php echo $entry->entry_date; ?> by <?php echo $entry->createdUser->first_name . " " . $entry->createdUser->last_name; ?></h6> <?php if ($entry->summary) { echo "<p>" . $entry->summary . "</p>"; } else { $body_text = strip_tags($entry->body); $text = substr($body_text, 0, 300); echo "<p>$text...</p>"; } ?> <a href="<?php echo $entry->url; ?>" class="button">Read on</a> </div><!-- /.news_index_text --> <?php if ($entry->main_image) { $news_image = $entry->main_image->size(240,180); ?> <img src="<?php echo $news_image->url; ?>" width="<?php echo $news_image->width; ?>" height="<?php echo $news_image->height; ?>" alt="<?php echo $entry->title; ?>" class="small_frame" /> <?php } ?> <div class="clear"></div><!-- /.clear --> </div><!-- /.news_box --> <?php } ?> <?php // PAGINATION LINKS $pagination = $news->renderPager(); echo $pagination; ?> <?php } ?> </div><!-- /#news_index --> <?php include("./footer.inc"); ?> Categories.php : <?php $name = $sanitizer->pageName($input->urlSegment1); $category = $pages->find("template=news_category, name=$name"); $news_cats = $pages->find("template=news_category"); ?> <div id="news_top_bar"> <h5 id="news_header">Recent news items - <?php echo ucwords($name); ?></h5> <?php if ($news_cats) { ?> <ul id="news_cats"> <li>By category: </li> <?php foreach ($news_cats as $cat) { $numArticles = $pages->count("template=news_entry, news_category_link=$cat"); if ($numArticles > 0) { ?> <li><a href="<?php echo $page->url . $cat->name; ?>"><?php echo $cat->title; ?></a> / </li> <?php } ?> <?php } ?> </ul> <?php } ?> <div class="clear"></div><!-- /.clear --> </div><!-- /#news_top_bar --> <?php $news = $pages->find("template=news_entry, news_category_link=$category, limit=1"); foreach ($news as $entry) { $class = "news_box"; if ($entry == $news->last()) { $class .= " news_box_last"; } ?> <div class="<?php echo $class; ?>"> <div class="news_index_text"> <h3><a href="<?php echo $entry->url; ?>"><?php echo $entry->title; ?></a></h3> <h6><?php echo $entry->entry_date; ?> by <?php echo $entry->createdUser->first_name . " " . $entry->createdUser->last_name; ?></h6> <?php if ($entry->summary) { echo "<p>" . $entry->summary . "</p>"; } else { $body_text = strip_tags($entry->body); $text = substr($body_text, 0, 300); echo "<p>$text...</p>"; } ?> <a href="<?php echo $entry->url; ?>" class="button">Read on</a> </div><!-- /.news_index_text --> <?php if ($entry->main_image) { $news_image = $entry->main_image->size(240,180); ?> <img src="<?php echo $news_image->url; ?>" width="<?php echo $news_image->width; ?>" height="<?php echo $news_image->height; ?>" alt="<?php echo $entry->title; ?>" class="small_frame" /> <?php } ?> <div class="clear"></div><!-- /.clear --> </div><!-- /.news_box --> <?php } ?> <?php // PAGINATION LINKS $pagination = $news->renderPager(); echo $pagination; ?> I've just re-read part of the pagination docs here and have added "start=0, limit=n" to my news_index template so now categories are showing even on 2nd page. Still can't seem to get pagination showing on categories template though
  7. 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.
  8. Hey. I had installed processwire two months ago and been building up the new site in the background on pw, while the old site was still online. I didn't have time to work on it so didn't look at it all April and now it doesn't work anymore. I can't get any pw page to show, not even the admin page ... it always displays the index.php file in the root directory if I try to go to any pw page. Can anyone help me? Can't figure out what happened! Many thanks in advance and best wishes Lars
  9. Hi, I'm setting up some next/prev page linking code. I only want those links to show if the page's publish_date field is less than today. Here's my convoluted and cobbled-together code: <?php $today = time(); if($page->prev->getUnformatted('publish_date')<$today) echo "<li id='prev'><a rel='nofollow' title='{$page->prev->title}' href='{$page->prev->url}'>{$page->prev->title}</a></li>"; if($page->next->getUnformatted('publish_date')<$today) echo "<li id='next'><a rel='nofollow' title='{$page->next->title}' href='{$page->next->url}'>{$page->next->title}</a></li>"; Firstly, is there a way to simplify this? Secondly, if there's no value returned for the previous page (for example) it still outputs the HMTL. ie: <li id='prev'><a rel='nofollow' title='' href=''></a></li> Thanks for any help. Cheers Marty
  10. I've been reading up on a few posts on categories but I'm struggling to get them working. I saw a video from PW1 and the example seems nice and simple:Output the categories, click one and the list of entries gets filtered. I tried to replicate that but no joy. I can't seem to understand how Ryan can output $page->categories from his page when really the categories are surely part of children()? Is it really possible to filter categories of events or news this simply? I've seen other examples in the forums which look much more complex (urlSegments and the like). I currently have my category page set up as a child of home, and categories as its children. Before seeing that video, I had managed to output the categories like this: <div id="events_index_side"> <?php if ($pages->find("template=category")) { ?> <div class="events_index_side_box"> <h5 class="page_header">By category</h5> <ul> <?php $categories = $pages->find("template=category"); foreach ($categories as $category) { ?> <li><a href="<?php echo $page->url . $category->name; ?>"><?php echo $category->title; ?></a></li> <?php } ?> </ul> </div><!-- /.events_index_side_box --> <?php } ?> but using this method, I'm not quite sure how I can get the page to reload with just those categorised entries? Would appreciate if anyone could give me a shove in the right direction. Thanks.
  11. Hi all, Hope that there is a quick tip that someone already know... Is it possible to search in multilanguage fields only in the current language values without to search in the default language as fallback? See the quote below. In other words.. I would like to search only in the current language (Dutch), no matter if some of the Dutch language values are empty. Is it possible? Thanks
  12. I'm building a little photography portfolio site and I'm running into a question with image->size(). For most applications, the sizing to fit and center-crop is great, but for this site, I want to have a maximum width and maximum height, so that if the photo is narrower than the specified size, it gets smaller and has space on the sides, and if it's shorter, it gets space on the top and bottom. In other words, I'm looking to size the image such that it never gets cropped; you see the whole image even if it means making it smaller. Is there a way to do that with size()?
  13. Hi guys I'm tweaking a module of mine (SocialTwitterFeed) to do something else and need to have an ASMSelect in the config screen -this bit is simple enough, however how do I limit it so the user can only select ONE page? Here's the current code: private static function _createInputfieldASMSelect($aName, $aTitle, $aValue, $aDesc='', $aPath='/') { if(!isset($aValue) || !is_array($aValue)) $aValue = array(); $modules = Wire::getFuel('modules'); $field = $modules->get("InputfieldAsmSelect"); $field->attr('name', $aName); $children = wire('pages')->get($aPath)->children; foreach($children as $child) { $field->addOption($child->id, $child->title); } $field->attr('value', $aValue); $field->label = $aTitle; $field->description = $aDesc; return $field; } In this case, it's being used to select a field, so here's the more relevant code that works, but currently selects multiple fields instead of just one: private static function _createInputfieldASMFieldSelect($aName, $aTitle, $aValue, $aDesc='', $aPath='/') { if(!isset($aValue) || !is_array($aValue)) $aValue = array(); $modules = Wire::getFuel('modules'); $field = $modules->get("InputfieldAsmSelect"); $field->attr('name', $aName); $children = wire('fields')->find('id>1'); foreach($children as $child) { $field->addOption($child->id, $child->name); } $field->attr('value', $aValue); $field->label = $aTitle; $field->description = $aDesc; return $field; } I posted both as thought the latter might be useful to someone already familiar with the former, and I'd be interested to see if there are any major differences required for the two. Cheers! Oh, and the addition is going to be that you can specify a field for the module so that you can enter a customised message for a given news item/article/whatever to accompany the title and link in the twitter post on a per-page basis rather than the blanket default message in the current version - though it'll fall back to the default message if no custom message is selected. Getting complicated, but very configurable
  14. What selector string should I use to return pages that have a specific page selected in a Page Fieldtype input? I searched around and tried multiple things, but couldn't find the answer. I really figured this should be easy, so I may totally be overlooking something. I have pages that can have any number of tags selected (through a Page Fieldtype input). I would like to return a PageArray of pages that have the "Featured" tag selected. (It doesn't have to be the ONLY tag selected.) I attempt to do that with the following code, but it is returning all the pages. $featuredTag = $pages->get('template=tag, title=Featured'); $featuredPages = $page->children("tags=$featuredTag"); Any idea what I'm doing wrong? Am I totally missing something? (A little more info, I am using checkboxes to select the tags in the Page Fieldtype input.)
  15. 1. Am new to PW and this forum so I'd like to say: Hello to everyone 2. PW is great 3. Got a problem with navigation, I think it should be simple but my brain stopped working here is the situation: Home --EN ----ABOUT ----OFFER ------PRODUCT1 ------PRODUCT2 --DE --FR etc. What I want to accomplish is to get class="on" added to OFFER when I am on PRODUCT page. Easy to get this done if not using EN, FR pages. Am not using translation functions from PW, languages EN, FR are just a pages. <!--?php $lang = $page--->rootParent->name; $homepage = $pages->get("/".$lang); echo "
  16. Hi, This might be a dumb question, but my jquery skills are still somewhere below zero. I do have the following jquery code in my external .js file. And it works fine, but, for maintenance and reusebility reasons, I don't like having the target url hard coded in the .js file. But I assume it isn't possible to pass the PW api $config->urls->root to this external .js file, would it? /*Make header div clickable*/ $(document).ready(function() { $('#header').click(function(){ window.location = 'http://www.mysite.com/'; }); $('#search_form').click(function(event){ event.stopPropagation(); }); }); /*End header div*/ /Jasper
  17. I have a selector that uses the page ID to narrow down items by a page field. Basically $pages->find("organization={$page->id}"); However, it doesn't work with one page, because it lacks an ID--how is this possible? What can I do to fix it? Thanks. This is in PW 2.2.0.1.
  18. Hi ProcessWire'ers, I'm a total newb, reading through the docs to try and get up to speed with PW. I read here that: But if I visit Admin > setup > templates then Edit > Advanced, I see no reference to URL Segments. Any comments on why would be most appreciated, cheers, -Alan
  19. I have a small search form that searches products by selected manufacturer, price or manufacturer and price combined. Manufacturer is a page list field, and the generated prices are a range. This is the form: <label for="search-manufacturer">Manufacturer</label> <select id="search-manufacturer" name="manufacturer"> <option value="">Any</option> <!--?php foreach($pages--->get("/manufacturer/")->children() as $manufacturer) { $selected = $manufacturer->name == $input->whitelist->manufacturer ? " selected='selected' " : ''; echo "{$manufacturer->title}"; } ?> </select> <label for="search-price">Price</label> <select id="search-price" name="price"> <option value="">Any</option> <!--?php foreach(array('0-50', '50-250', '250-500', '500-750', '750-1000', '1000+') as $price) { $selected = $price == $input--->whitelist->price ? " selected='selected'" : ''; echo "$price"; } ?> </select> <input type="submit" id="search-submit" name="submit" value="Search"> What code do I need to put into "manufacturer-search" template to search products by criterions mentioned above? I've looked into the skyscapers profile but couldn't make it work... Thanks
  20. Hi, I am trying to find the url of some pages, I have the page ID so I figured that something like this should work. $linkurl = wire('pages')->get(1187)->url ... do something ... $linkurl = wire('pages')->get(1186)->url ... do something ... $linkurl = wire('pages')->get(1093)->url ... do something ... $linkurl = wire('pages')->get(1097)->url ... do something ... But whatever I try I get the root url as $linkurl. I even tried it with ->title, just to see what happened. Every time I got the title of the homepage. Am I doing something wrong or is wire('pages')->get(id) not working? I use the latest commit. //Jasper
  21. When a new field created, if hit save without selecting a fieldtype it throws an white page error. Fatal error: Call to a member function attr() on a non-object in /Applications/XAMPP/xamppfiles/htdocs/pw-dev/wire/modules/Process/ProcessField/ProcessField.module on line 636 This error message was shown because site is in debug mode ($config->debug = true; in /site/config.php). Error has been logged.
  22. I'm having a problem with incorrect "created" dates. "created" dates are showing one day ahead. I don't think it's the server because I did a echo date("Y") and it shows the correct date. I'm doing this echo date("Y m d", $page->created); to show the page/article date. The timezone is set to New York time, which is fine as it's close enough. I'm wondering if this problem is coming up because it's a leap year. I didn't want to fish around the core to find out how "created" was set after looking around and not being able to find it. Anyone have any thoughts on this, or how to fix it?
  23. What is the best way to add an image to one of my navigation links? I would like to add an image tag right before my homepage link, within the anchor tags. Starting from the default navigation code: $homepage = $pages->get("/"); $children = $homepage->children; $children->prepend($homepage); foreach($children as $child) { $class = $child === $page->rootParent ? " class='on'" : ''; echo "<li><a$class href='{$child->url}'>{$child->title}</a></li>"; } I tried editing the $homepage variable to concatenate an image tag before $pages->get("/"); but that threw an error since (I'm guessing) the prepend() method is specific about the kind of input it will take in its parameter. I'm probably going about this all wrong. Any help would be greatly appreciated.
  24. Hello, Somehow I can't seem to get a new user role to publish new pages -- only create and save unpublished. I created a new role called "editor" with view, edit, delete, and move permissions. I also allowed access management on the appropriate template. Still nothing. What am I missing? I'm using PW 2.2. Knowing how this goes, I'll probably figure this out in a second or two...! Tempting fate, -e.
  25. I'm using the in-context editing menubar plug-in, and to avoid confusing my clients, I'd like to be able to remove the little edit button that shows up in the corner of front-end pages by default. What's the best way to go about doing this?
×
×
  • Create New...