Jump to content

Search the Community

Showing results for tags 'tags'.

  • 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. EDIT: Not sure why it didn't work the first time I tried it, but creating a tag without the space or hyphen did eventually work. I'll have to use my workaround (since I can't omit the space in the title of the page). Mods are welcome to delete this post or leave it for someone else who might run into the same thing. I thought I was doing something to make life easier on myself (this is how all tragedies begin). On a site (live, of course), I had two separate areas where product literature documents were referenced. There is a product literature section, and individual product pages. Before, in each template, I was linking to static URLs for files that were placed on the site via FTP. What usually happened was that I'd upload a file to the Literature section and forget to add it to the product page. Yesterday I decided that it would be less complicated (and more fool-proof) to use a File upload field in the Product Literature section, with tags that match the titles of the product pages, so that the product's template could pull from the same files. I thought tags would allow me the flexibility to add any tag I might need down the line. With some fits and starts, I got it working yesterday for two categories of document (I thought). Today, I tried to finish up the task and noticed that two of the products are not pulling any documents at all. My first instinct, because mysql searches have burned me before, was that the tags "Spectra 500" and "RDS-30" were falling under the search term limits. "Spectra 1000" and "Spectra 1100" work as intended. Reading up in the forums seemed to agree about the search phrase length. I went to the site and did a quick change up of the product page's title and the tags on the document to test, but changing the terms to "Spectra500" and "RDS30" didn't correct it. Later this did start behaving as expected, not sure why I had misleading results from my first attempt. So I set up and coded a workaround (thinking a multi-Page Select field on the literature page and a corresponding text field for the product pages). Final code to pull files on pages of template "document" using Page Multiselect from the template of pages of template "product": $datasheets = $pages->find("parent=/product-literature/product-data-sheets/,template=document,product_tag=$page"); $manuals = $pages->find("parent=/product-literature/product-instruction-manuals/,template=document,product_tag=$page"); if(count($datasheets)) { echo "<div class='col span_2_of_4'>"; echo "<section class='reports'>"; echo "<h4 class='section_names'>Available Product Documentation</h4>"; foreach($datasheets as $datasheet) { echo "<div>"; $datasheetLink = $datasheet->get("254_file")->url; echo "<a href='{$datasheetLink}' target='doc_window'><img src='{$config->urls->assets}images/documenticon.png' class='floatleft' alt='{$datasheet->title}'>"; echo "<p class='file_names'>{$datasheet->headline}</p></a>"; echo "</div>"; } if(count($manuals)) { foreach($manuals as $manual) { echo "<div>"; $manualLink = $manual->get("254_file")->url; echo "<a href='{$manualLink}' target='doc_window'><img src='{$config->urls->assets}images/documenticon.png' class='floatleft' alt='{$manual->headline}'>"; echo "<p class='file_names'>{$manual->headline}</p></a>"; echo "</div>"; } } echo "<br /> <br /></section>"; echo "</div>"; } else if(count($manuals)) { echo "<div class='col span_2_of_4'>"; echo "<section class='reports'>"; echo "<h4 class='section_names'>Available Product Documentation</h4>"; foreach($manuals as $manual) { echo "<div>"; $manualLink = $manual->get("254_file")->url; echo "<a href='{$manualLink} target='doc_window'><img src='{$config->urls->assets}images/documenticon.png' class='floatleft' alt='{$manual->headline}'>"; echo "<p class='file_names'>{$manual->headline}</p></a>"; echo "</div>"; } echo "<br /> <br /></section>"; echo "</div>"; }
  2. Hi Guys, So I am working on a project and wanted to get the best advice using the api on the next step. I have two image fields in one template. postimage which holds an image for the article and postimage2 which holds an image for the home page. Basically I want to make it so that when a user uploads postimage and not postimage2 the home page will just pickup postimage instead. If the user does upload postimage2, it should pick up postimage2. What I did: I did add a conditional statement to check if postimage2 was empty to simply default to postimage but I was not seeing any images display. Here is my code: <?php foreach($featured as $featuredp){ foreach($featuredp->postimage2 as $postimages2) { echo"<div class=\"row panel\" style=\"margin:20px auto;\">"; echo"<div class=\"large-4 columns\"><p> <a href='{$featuredp->url}'><img src='{$postimages2->url}' width=\"300\"/></a></p></div>"; echo"<div class=\"large-8 columns\"> <h4>{$featuredp->title}</h4> <p><em>{$featuredp->date}</em></p> <p>{$featuredp->summary}</p> <p><a href=\"{$featuredp->url}\" class=\"button tiny radius\">Read More</a></p> </div> </div>"; $found = 1; } } if ( ! $found ) { echo"<p>Sorry, no posts.</p>"; } ?> Any advice is appreciated? Also any suggestions or workarounds are also welcome!
  3. If I am implementing a 'free tagging field', which is explained by @ryan here > https://processwire.com/talk/topic/71-categorizingtagging-content/ is there any way to do this for more than one word (for example if a tag I entered is 'green energy') So, I have a tag.php template which uses something like: <?php if ( $tag = $sanitizer->selectorValue($input->urlSegment1) ) : ?> <?php $matches = $pages->find("tags*=$tag"); ?> <?php foreach ($matches as $match) : ?> <?php endforeach; ?> <?php endif; ?> This allows me, using url segments, to do: /tags/green and the results with a tag 'green', would come up. But how would I do it for something like 'green energy', so /tags/green+energy or /tags/green-energy... Currently my free tagging field is just a text field, but I could make this into a repeater, for example, if it helps this situation. Thanks in advance
  4. Hello All! This is my first post here and am a newbie with PW. So far I've been able to accomplish everything I've wanted to do dynamically in my first PW site, but ran into a big snag yesterday. Ok here's the setup: I have on my site 4 pages that deal with separate plumbing services. We offer a discount coupon for each service. For each service, I am displaying it's coupon image in the sidebar. Each coupon image resides in the images field of the individual rootParent parent services page, and each image has a tag of "coupon" assigned to it. So for example, I have a rootParent level "Drain Cleaning" page and it is in this page's images field that the Drain Cleaning coupon image resides with the tag "coupon." The next coupon resides in the images field for my rootParent "Sewer Cleaning" page, and so on. For each service page, I have some Hanna Code I wrote to include the coupon image in the sidebar of the rootParent and all of it's children: $coupon = $page->rootParent->images->getTag('coupon'); This works great! Now, here's my problem... For pages other than the service pages, like form confirmation pages, the Contact Us page, etc., I still want to display a coupon image in the sidebar, but I want to grab a random coupon image and display it. So far, I have not found a way to successfully scan all page's images field, grab the images with the tag of coupon, then display a random image. Here is the code I've come up with so far that is not working: First, build the array of pages containing an image with the tag of coupon (this works): $couponpages = $pages->find("images.tags=coupon"); Next, get the images tagged coupon from the array of pages containing them (this is where the code breaks and throws an error): $coupons = $couponpages->images->getTag("coupon"); The error reads: "Fatal error: Call to a member function getTag() on a non-object." Beyond that, I would then want to fetch a random image and display it: $coupon = $coupons->getRandom(); echo "<img alt='{$coupon->description}' src='{$coupon->url}' />"; If anyone can help me solve this it would be most appreciated! Thanks, Dave
  5. hello to everyone, i'm salles first please forgive my grammar as english is not my native language although i've been "watching" processwire for a while, this is the first time i'm considering processwire for a project. pw seems to be somewhat easy for non developers like me, it actually reminds me a bit of kirby cms. until we deal with common blog features... for example: how do we deal with categories and tags groups (each group for different sections of the site). and how to set up them? i know there's a blog profile, but honestly i think it's a bit too tricky to create php functions just to create simple things like categories and tags. especially for non php coders. i think common blog features should be built in the core like most cms's. cheers, salles
  6. Hey there everybody, yet another general question in the attempt to clarify some of my understanding. I have a great tag system up and running and would like to provide the client a quick way to tag multiple items within the site. There are situations as such: A batch of work is going to be displayed in a section that pulls via a selected tag. These works will be selected individually and may be based on all sorts of criteria things like price, or medium, or artist country of origin. For this what I invision is the ability to create a selector in batcher and update all of these items with a specific tag. Is this funcitonality something that already exists in a module? I know I can currently build these queries in batcher, but unfortunately there is no way to add fields to the editior to be able to batch update many items.
  7. I've followed a tutorial on setting up tags and have a tag field as follows: type=page allow new pages to be created from field=yes input field type - Asmselect Using the following on my template, I can output all the tags on my site <H3>Tags</H3> <?php $tags = $pages->get("/tags/")->children->find("sort=title"); echo "<ul>"; foreach($tags as $tag){ //iterate over each tag echo "<li><a href='{$tag->url}'>{$tag->title}</a></li>"; // and generate link to that page } echo "</ul>"; ?> What I'd like to do is echo only the tags used on the page being displayed. I thought the trick was to use $page instead of $pages as follows <?php $page->get("tags"); foreach($tags as $tag){ //iterate over each tag echo "<a href='{$tag->url}'>{$tag->title}</a></li>"; // and generate link to that page } ?> No joy. I think I know why. it's because my field called tags has a separate page for each tag so I probably need to use something like $page->get"tags" ->children Obviously thats not realy php but my literal interpretation. Just wondering if I'm on the right track and where I am going wrong.
  8. I'm building a site for a college where they teach approx 20 courses. Each course page will have a: tutor duration price and I'd like each of these to be clickable tags whch loads a page listing matching courses. So if Prof. Beezlebub is teaching religion, I want web users toclick his name and see a list of his other courses etc In the PW admin, I want editors to be able to specify what courses contain which tags. Can someone give me a very basic overview of whats involved. I don't see a field type called Tags in the Filed setup. I also want to make sure that a tag from a Courss will load a list of other courses, but not any matching tags from say, a blog. Many thanks
  9. I was looking for a way to group fields within the admin today and came across this wiki entry which does just that http://wiki.processwire.com/index.php/Template_Tabs IE have fields nested under certain categories when editing a page such as General Content (heading/category) Summary (nested field) Body (nested field) Featured Content (heading/category) Homepage images (nested field) Homepage summary (nested field) I was wondering if there were plans to make this a little more straightforward and perhaps use Categories or Tags. We already use Tags to group fields on the main fields (admin >setup >fields) and could this be extended slightly?
  10. I didn't exactly just start using ProcessWire. But does anyone know how would I go about retrieving the pages with a certain tag into separate sections based on their parent? Problem lies in the fact that both photos and featurettes (videos) share the same tags, and their thumbnails have a different aspect ratio. Which is pretty much why I'd like to have them separated, if a certain tag has been used on both content types. Parent names are "photos" and "featurettes". Needless to say, the current code isn't really good nor a beauty to look at. But I've attached it, and I'd appreciate any help. $thisTag = $page->title; $tdsphotos = wire("pages")->find("tagsx.title=$thisTag, limit=8, sort=-created"); $pagination = $tdsphotos->renderPager(array( 'nextItemLabel' => "Next", 'previousItemLabel' => "Prev", 'listMarkup' => "<ul class='pagination'>{out}</ul>", 'itemMarkup' => "<li>{out}</li>", 'linkMarkup' => "<a href='{url}'>{out}</a>" )); echo "<div class=\"littleboxes\">\n"; foreach($tdsphotos as $tdsphoto){ $otep = $tdsphoto->images->first(); $thumb = $tdsphoto->images->first()->size(210, 210); $out .="<div class=\"inabox\">"; $out .="\n<a href=\"{$tdsphoto->url}\"><img alt=\"{$otep->description}\" title=\"{$otep->description}\" class=\"img-thumbnail img-responsive\" itemprop=\"thumbnailUrl\" src=\"{$thumb->url()}\" width=\"{$thumb->width}\" height=\"{$thumb->height}\"></a>"; $out .="<h6 itemprop=\"name\"><a href=\"{$tdsphoto->url}\">{$tdsphoto->title}</a></h6>"; $out .="\n</div>\n"; } echo $out; echo "</div>\n"; echo $pagination; Thanks!
  11. I am still learning the tags in processwire so I think this will be an easy question. I am trying to create a tag that will display the path from the root to an image file that includes the image filename and extension. I think I am close with the following, but how do I add the filename and extension? <?php echo $page->image1_thumb->url ?> Thank you. Bill
  12. horst

    (no topic title)

    in addition to pwired here http://processwire.com/talk/topic/3785-alternative-syntax-for-control-structures-a-tip-for-newbies/#entry37007 http://processwire.com/talk/topic/3691-tutorial-a-quick-guide-to-processwire-for-those-transitioning-from-modx/?view=findpost&p=35953 http://processwire.com/talk/topic/3754-proof-of-concept-processwire-admin-theme-switcher/?view=findpost&p=36621 http://processwire.com/talk/topic/3785-alternative-syntax-for-control-structures-a-tip-for-newbies/?view=findpost&p=36950
  13. I decided to rebuild an old image gallery site with PW. I know there's countless image-gallery scripts out there, but for my liking, most of them are too bloated. Also, I thought this was another good opportunity to dive further into PW-world. I'm keeping the old basic gallery structure: 95% of the galleries are in date-folders (monthly), like a blog archive. But I'd like to add some filter / search functionality, because there's just so many pics - when you come to the site and look for a specific subject, there was no way to do that on the old site. Q 1: How can I create a simple "search by image tag"? I want the results to list all images (thumbs) with tag x, and a link to the parent page. Q2: How would I most efficiently grab all tags from all pages, all images, and present it alphabetically (not necessary a fancy tag-cloud, but making sure I list each unique tag only once)? So when the user clicks on one tag link, he sees all image thumbs that have that tag on the results page. $p = $pages->find("images.tags~=$tag") works fine. I can explode("|", $p) to get a page-id array, but where would I go from here? A tag can be any anywhere, in various galleries (pages), and most pics have multiple tags. I'd like to group the results by page, so I guess I need to add 1-2 foreach loops, no? Can somebody help with some example code? I'm a bit stuck right now.
  14. Hi all, i think i need some help with this: I have a field called Tags, which is a pageAutocomplete field, and allows the user to enter tags for a page; Then on the template i have an isotope display which has a filter, using the tags; Right now i'm just cycling through the tags (selector for template=tag) to create the list of filter links; but is there a way to check that a given tag is actually in use, by a page, since right now if someone enters a tag and then deletes it, that tag is still a tag page, but if you click on that filter, no items are displayed... TIA
  15. Hey everyone, I'm trying to build a single-page portfolio on ProcessWire, I think I've got the header and footer right, but I'm having doubts on how to setup the portfolio area. I was hoping you guys could give me a hand since I'm very used to ExpressionEngine designer-friendly tags. My english is not very good so I created an image to show what I'm trying to do: http://i46.tinypic.com/23r1tl3.png So I'm trying to figure out is: -how to create the slider for every project I add -how to create tags or categories for every project The date I suppose I should use the datepicker field, right? And title and description are basic text fields...
  16. Im aware you can echo content based in tamplate, parent page etc, but is there a generic tags field type module that can be used to add several tags to a page and use to link to other tagged pages? Thanks for your help
  17. hello forum, after a bit a humble start i think i've wrapped my head around pw a little better... that's why i'm now in the general support forum and not any longer in getting started ;-) however, i'm working on a portfolio site for an engineering company and i've set up categories to organize the way their work is presented on the site. setting up the categories was easy and works good thanks to the tutorials in the forum here. but now i would like to present the categories as a tag cloud and therefore need to get the number, how often each category has been chosen for a portfolio item (aka page). this is a bit over my head in php. could someone point me in the right direction? thanks pretty much in advance!
  18. Today I tried to create a News feed, and I think it became pretty good! But there is one problem, I have marked it in the code - so if anyone have a clue, tell me! This one requires two template; news.root (title) and news.article(title, body, summary, news_tags[comma separated values], images[optional]). CSS: .news-item .news-image{ width:250px; border:1px solid #CCC; text-align:center; vertical-align:middle; padding-top:2px; display:block; } .news-item .news-summary{ width:auto; } .news-item .news-image p{ padding:1px; margin:0px !important; text-align:center !important; } .news-item .news-read-more{ text-align:right; } .news-item .news-read-more a{ color:#373737 !important; } .news-item .news-read-more a:hover{ background:none !important; text-decoration:underline !important; } .news-item{ border-bottom:.4px dashed #CCC; } .news-item p{ text-align:left; } .news-pager { clear: both; margin: 1em 0; font-family: Arial, sans-serif; } .news-pager li { display: inline; list-style: none !important; list-style-type:none !important; margin: 0; } .news-pager li a, .news-pager li.separator { display: block; float: left; padding: 2px 9px; color: #fff; background: #2f4248; margin-right: 3px; font-size: 10px; font-weight: bold; text-transform: uppercase; } .news-pager li.active a, .news-pager li a:hover { color: #fff; background: #db1174; text-decoration: none; } .news-pager li.separator { display: inline; color: #777; background: #d2e4ea; padding-left: 3px; padding-right: 3px; } the news.root.php template <?php include("./head.inc"); /** * News template, the base part! * * By Max Allan Niklasson */ $tagQuery = $sanitizer->text($input->get->tag); $label = (object) array( 'altTag' => 'Bild', 'postedUnder' => 'Postad under', 'readMore' => 'Läs mer »»', 'published' => 'Publicerad den', 'by' => 'av', 'prev' => 'Föregående', 'next' => 'Nästa', 'tagExpl' => 'Filtrering av nyheter med taggen: <em>'.$tagQuery.'</em>, visar %s träff(ar) av %s träff(ar). <br/> <a href="'.$page->url().'">Visa alla nyheter</a>' ); /** Here I have one issue when set limit = 1, the pager don't work... Solution? **/ $limit = 3; //To fix the pager $start = ($sanitizer->text($input->get->page) ? $limit * $sanitizer->text($input->get->page) - $limit : 0); function thumbGet(Page $page, $label){ if($page->images){ $image = $page->images->first(); if($image){ if($image->width() > 250){ $thumb = $image->size(250); }elseif($image->height() > 250){ $thumb = $image->size(0, 250); }else{ $thumb = $image; } $return = "\n\t\t\t\t\t\t\t\t". '<div class="news-image">'. "\n\t\t\t\t\t\t\t\t\t". '<img src="'.$thumb->url().'" alt="'.$label->altTag.'" />'. "\n\t\t\t\t\t\t\t\t\t". '<p>'.$image->get('description').'</p>'. "\n\t\t\t\t\t\t\t\t". '</div>'; return $return; }else{return false;} } else{ return false; } } function processNewsItem(Page $news, $label, Users $users){ $writer = $news->createdUser; $tags = split(',',$news->news_tags); echo "\n\t\t\t\t\t".'<div class="news-item">'; echo "\n\t\t\t\t\t\t".'<h2>'.$news->title.'</h2>'; echo "\n\t\t\t\t\t\t\t".'<p>'; echo "\n\t\t\t\t\t\t\t\t".'<div class="news-summary">'.$news->summary.'</div>'; if(thumbGet($news, $label)){ echo thumbGet($news, $label); } echo "\n\t\t\t\t\t\t\t".'</p>'; if($tags[0]){ echo "\n\t\t\t\t\t\t\t". "<div class='news-info'>"; echo $label->postedUnder.": "; $tagCount = 0; foreach($tags as $tag){ if($tagCount != 0) {echo ' | ';} echo "\n\t\t\t\t\t\t\t\t". '<a href="?tag='.$tag.'">'.$tag.'</a>'; $tagCount++; } echo "\n\t\t\t\t\t\t\t\t". '<div class="news-published">'.$label->published.': '.date("Y-m-d \k\l\. H:i:s", $news->created).' '. $label->by .' '.$writer->name.'</div>'; echo "\n\t\t\t\t\t\t\t". '</div>'; } echo "\n\t\t\t\t\t\t\t".'<div class="news-read-more">'. "\n\t\t\t\t\t\t\t\t".'<a href="'.$news->url.'">'.$label->readMore.'</a>'. "\n\t\t\t\t\t\t\t".'</div>'; echo "\n\n\t\t\t\t\t".'</div> <!-- news-item -->'; } function pagination(PageArray $cPages, PageArray $tPages, $label, $limit, $sanitizer, $input){ //The URL fix $URL = ($sanitizer->text($input->get->tag) ? '?tag='.$sanitizer->text($input->get->tag).'&page=#NR#' : '?page=#NR#'); //Calculate number of matches that should be viewing $calc = $cPages->count(); //The Totally number of pages $tot = $tPages->count(); $pages = round(($tot / $limit) + 1); if($tot <= $limit){ }else{ echo '<ul class="news-pager">'; if($pages <= $sanitizer->text($input->get->page) && 0 < ($sanitizer->text($input->get->page) -1) ){ echo '<li><a href="'.str_replace('#NR#', ($sanitizer->text($input->get->page)-1), $URL).'">'.$label->prev.'</a>'; } for($i = 1; $i <= $pages; $i++){ $class = ''; if($sanitizer->text($input->get->page) == $i){ $class = 'class="active"'; }elseif($sanitizer->text($input->get->page) == 0 && $i == 1){ $class = 'class="active"'; } echo '<li '. $class .'><a href="'.str_replace('#NR#', $i, $URL).'">'.$i.'</a>'; } if($pages >= $sanitizer->text($input->get->page) && $pages >= ($sanitizer->text($input->get->page) +1) ){ echo '<li><a href="'.str_replace('#NR#', ($sanitizer->text($input->get->page)+1), $URL).'">'.$label->next.'</a>'; } echo '</ul>'; } } ###### Let's Print it out! ####### /** The viewer from tag query **/ if($tagQuery){ $counter = $page->children('template=news.article, news_tags*='.$tagQuery.', sort=-date, sort=-id '); $newsItems = $page->children('template=news.article, news_tags*='.$tagQuery.', sort=-date, sort=-id, start='.$start.', limit='.$limit); if($newsItems->count()) { printf($label->tagExpl, $newsItems->count(), $counter->count() ); echo "\t\t\t\t".'<div class="news-list">'; foreach($newsItems as $news){ processNewsItem($news, $label, $users); } echo "\n\n\t\t\t\t".'</div><!-- news-list -->'; } }else{ /** The Normal News viewer **/ $counter = $page->children('template=news.article'); $newsItems = $page->children('template=news.article, sort=-date, sort=-id, start='.$start.', limit='.$limit); if($newsItems->count()) { echo "\t\t\t\t".'<div class="news-list">'; foreach($newsItems as $news){ processNewsItem($news, $label, $users); } echo "\n\n\t\t\t\t".'</div><!-- news-list -->'; } } pagination($newsItems, $counter, $label, $limit, $sanitizer, $input); include("./foot.inc"); But there is one thing that I wonder about, is it necessary to attach ($label, $sanitizer, $input etc.) in the function? When I tried global but it didn't work...
×
×
  • Create New...