-
Posts
48 -
Joined
-
Last visited
Everything posted by jan
-
Thats it. I tried it before, and it didn't work because of a mistake I made... Thanks a lot! That was exactly what I was looking for!! Works perfect!
-
Hi, and thanks for your super fast reply! It works. I didn't know, that it is this simple! Realley great! But now I habe another problem: If I have a page that has the categories "print" and "video", I do it as you proposed, like this: $catPages = $pages->get("/system/category")->children->find("title=print|video"); as result I get returned the two pages from "system/category", which is correct. The results, when I perform my search like $result = $pages->find("parent=/articles/, body*=$query, categories=$catPages"); is a logical OR. So I get pages, having only the category "print" and other only having category "video", or both. My searchquery looks like this: articleCategory=1018|1020, limit=50, template=article Can you tell me, how I can do a logical AND in this case?! I want only pages that have "video" AND "print" selected. Thanks again!
-
Hi there, I'm trying for hours the following: In the backend I have article pages containing a field "categories". The field "categories" has pages you can select via checkbox in the backend. These pages are status "hidden" under a node "system". It looks like this: Home Articles Article 1 (has selected e.g. /System/Category/print) Article 2 (has selected e.g. /System/Category/print and video) Article 3 System Category print internet video audio I've implemented a frontend search. There you can search all articles an you can select of which category the results are. My problem is, I don't have any glue, how I can filter the articles, to get only results for the categories selected. What can the selector string look like? Is there another way how I can do it? I ended up in very complicated "foreach"s and so on... Thanks a lot for your answers in advance!!
-
Is this a proper way to get an image from the Home page?
jan replied to MarcC's topic in General Support
Oh sh**. I'm sorry. I found my mistake and it's really more than simple! I made two new entries in Processwire backend to test the blog. One of these two entries had images, the other didn't have any... So thanks @Soma you were on the right track! I just tried to change size of an image that was not there. Surprise! Ok after all, thanks for your effort!!! *embarrassing* -
Is this a proper way to get an image from the Home page?
jan replied to MarcC's topic in General Support
@JeffS Thanks a lot for your replay. Im not using the new blog profile. Here's some more code. I'm using something similar on another page and everthing works fine. I can't see a difference. Can you find any mistakes?! $blog_entries = $pages->get("id=1008")->children; foreach($blog_entries as $blog_entry) { $image = $blog_entry->blog_images->first(); $blog_thumb = $image->width('500'); echo "<div class='blog_overview_item' >"; echo "<h2><a href=\"{$blog_entry->url}\">{$blog_entry->title}</a></h2>"; echo "<p>posted on ". date("d.m.Y, H:i", $blog_entry->created) ."</p>"; echo '<div class="blog_preview_image">'; echo "<a href='{$blog_entry->url}'><img width='{$blog_thumb->width}' height='{$blog_thumb->height}' src='{$blog_thumb->url}' alt='{$blog_thumb->description}' /></a>"; echo "</div>"; echo "</div>"; } If I remove resizing of the image, everything works fine. If I try $image->width('500'); or $image->size(500, 500); I get the error. Any ideas? -
Is this a proper way to get an image from the Home page?
jan replied to MarcC's topic in General Support
Hi there, don't know if there's already a solution. I was trying the following: $image = $blog_entry->blog_images->first(); $blog_thumb = $image->width(500); As result I get: Error Call to a member function width() on a non-object As I found out, the $image object seems to be returned propably. Any ideas, what's going on? Thanks for your replies in advance!! -
Hi, unfortunatelly I've got a problem with the module. If I chose "TextboxList" for a field, there's no way to switch back to normal "TextArea". Is this because of the own fieldtype of TextboxList? Is there a way to tell the module what compatible fields are? In addition, I'd also try to make the InputField independent from the Fieldtype, but I'm not sure if I've got the skills yet... But perhaps with a little support, I can do it. I think a checkbox, to turn TextboxList als input on an off should be enough, right?
-
@alan: I just corrected a small mistake in the code above. If you want to check if there are any results for your query than you can use if(count($results)) { ... } (before I wrote if($results) which does not work.) Good luck and have fun, I'm still in love with ProcessWire Sometimes I'm also wondering about my brain.... I'm not sure, if I got your post right (my english is not very good at all...), but if you do not want to show all the page links (== numbers), you can try the option numPageLinks like $pagination = $results->renderPager(array( 'numPageLinks' => 3 )); I didn't try it, but perhaps 0 is also allowed as value, if you only want to show 'prev' and 'next' buttons. Reference of all options is at the bottom of this page: http://processwire.c...rkup-pager-nav/
-
Stupid me... I thought the displaying numbers are showing that page numbers are already enabled in template. You're completly right... Thanks a lot!
-
About 5 month later, I have nearly the same problem and can not explain to myself what's going on. I want to use pagination on the homepage/ root page. I created a homepage template that displays articles from this structure: /homepage/articles/article. So I try to paginate all the single articles lying beneath "/homepage/articles/" (hope this is not confusing). It's HOME ARTICLES Article 1 Article 2 Article 3 ... I was trying this code: $results = $pages->find("template=article, limit=15, sort=title"); if(count($results)) { $pagination = $results->renderPager(array( 'nextItemLabel' => "next", 'previousItemLabel' => "prev", 'listMarkup' => "<ul class='MarkupPagerNav'>{out}</ul>", 'itemMarkup' => "<li class='{class}'>{out}</li>", 'linkMarkup' => "<a href='{url}'><span>{out}</span></a>" )); echo $pagination; echo "<ul>"; foreach($results as $result) { echo "<li><p><a href='{$result->url}'>{$result->title}</a><br /><span class='summary'>{$result->articleDescription}</span></p></li>"; } echo "</ul>"; echo $pagination; } As result, I get the pagination navigation, but it's not working correctly. Clicking through the pages shows always the same results. This query didn't work eather: $results = $page->child("title=articles")->children("limit=5"); Any ideas? I was now trying for hours...
-
Thanks a lot. Now I got it. Only as a short summary - is there still potential of errors using the repeater? You should not: Clone a template, that uses repeater fields? Does anything else work fine?
-
Thanks a lot for the super fast answer. Curiously, my 2.2.0 installation does not offer the repeater field. The module is simply not existing. I know, it's a little bit off topic, but is it right, that updating the version of Processwire is simply replacing the "wire" folder? Tranks again and best regards. PS: I found the information her: http://processwire.com/api/directories/ I'm afraid of crashing everything..
-
Hi there, my question is: can I use the new RepeaterField as a module in processwire 2.2.0 stabel? Thanks a lot for your reply, and sorry, if I should have missed the answer in this thread... And Ryan: Thanks a lot for your processwire, all your work and all your great ideas. I really love it!! Regards!