-
Posts
54 -
Joined
-
Last visited
Everything posted by ptjedi
-
Thank you Ryan for your quick assistance. I've tried to reproduce what you suggest but with little success. My own example is similar to the Skyscrapper one that I mentioned, but I think it's better to explain everything from bottom-up: This is a catalog that has 2 types of entities (templates): products and attributes. Both are pages (of course) and I have Dropdown menus inside products that let me choose from the attributes created outside the tree of pages. My tree looks like this: Home Page 1 Page 2 Catalog Products Product 1 Product 2 Product 3 ... [*]Types Type Attribute 1 Type Attribute 2 ... [*]Areas Area Attribute 1 Area Attribute 2 ... So, for each product I can associate with a Type and multiple Areas. What I need is: given the Area, list all Types that are selected inside that area's products. This, inside a page OUTSIDE the catalog, so I need to point everything in there. Here's the code I am using: $area = $pages->get("/catalog/area/")->find("title*=Hospital"); // gets page that contains "Hospital" in title (will return only one) $products = $pages->get("/catalog/products/")->find("catalog_product_area=$area"); // lists all products that matches that attribute $types = new PageArray(); foreach($products as $product) { $types->add($product->parent); } $types->sort('title'); echo $types->render(); The result shows the following: Produtos 1 2 3 4 5 6 7 Next Any idea?
-
Hello everyone, I am struggling here with a problem for I wish there is a more elegant solution. Picking up the Skyscrapers demo example, if I wanted to list all architects that had any kind of participation on a specific city, what would be the correct process? I can always list all buildings, pick up their architects, store them in a variable and get rid of duplicates, but I am pretty sure PW has a more interesting approach to the problem. Can anyone help me out on this one? Thanks!
-
Of course... so basic. Thank you for helping me out, diogo (again).
-
Hi everyone, I am sorry if this question is somewhere in the forums already, but I've passed my last hour searching for it's answer and I couldn't find it. The problem is the following: I have a Checkbox Page Field inside a Repeater Field. Basically, what I need is to get the title of the selected page(s) in that item. I've tried the following: <?php foreach($page->banners as $banner) { // cycles through repeater items var_dump($page->pagefield->title); What can I do?
-
Perfect, Soma. I tested it and it works as predicted. Many thanks!
-
Hello everyone, I've been following this thread a bit and I've implemented the module, configured it as the manual instructs and it seems to work very well. However, there is a question: what's the right procedure to build a language switcher for the front end. I've tried: <a href='./?language=default'>Português</a> | <a href='./?language=en'>English</a> | <a href='./?language=fr'>Français</a> However, even though the language do switches, the URL remains the same. For example: Current page is domain.com/pt/contactos/ Clicking the link to french, gets me to the page domain.com/pt/contactos/?language=fr while what I want was for it to go to domain.com/fr/contacts/ I am sorry if the solution has already been published in the forum, but I just can't find it. Thanks in advance for any kind of help.
-
Thanks you both for the valuable tips and suggestions. I used most of Processwire's default template because this was a cheap project. But it was great to try PW for the first time, implementing a bilingual structure and other interesting (yet simple) features such as the dynamic gallery and news section. I'm already picking up other work, and one thing I realize that PW isn't very good at is about exporting/importing a template+fields. Copying the php file plus adapting all fields is an enduring task. Isnt' there a way to to this faster?
-
Hi everyone, Just wanted to share this project I finished last month for a client. The design is not mine. I've implemented and converted the Illustrator mock-up into Processwire, and it went very well. There are some things regarding the design I would have change, but I could not go against the designer. Here's the link: http://www.setaiasia.com Special thanks to diogo, soma, yellowled for the support and, of course, Ryan for creating this wonderful tool.
-
Sounds great. Looking forward to test that module.
- 8 replies
-
- reciprocal
- pages
-
(and 1 more)
Tagged with:
-
Thanks you both. I imagined something like that, and it will come handy when I am setting the template files for it. However my question goes toward something that identifies in the backoffice that some page has been linked from another and therefore, holds a link to that page. Have any idea if this is feasable without touching core code?
- 8 replies
-
- reciprocal
- pages
-
(and 1 more)
Tagged with:
-
Good evening, I am trying to build a system that relates two pages (using a Page field) but assures that the related page also relates to the current page we're editing. Like if we were talking about synonyms. Does anyone have a clue on how to achieve this? Thanks!
- 8 replies
-
- reciprocal
- pages
-
(and 1 more)
Tagged with:
-
I confirm that the limit is set to 1. First time I tested that limit so it was confusing. Thanks again, Diogo. Almost finishing my first PW project for a client!
-
Got it. The problem was related to the fact I only uploaded one file and it seems that when only one file is uploaded, I cannot refer to the field content as an array. This means that this is enough: $file = $page->files; I knew this was a simple thing.
-
I also can't find any example (been looking a lot through the site and forum) regarding file upload and listing them afterward in a page. Could anyone point me in the right direction, please?
-
Greetings, I wonder if someone can help me with this issue. I am trying to use a file uploaded via backoffice in a template file but with no success. I am using the same sintax as images, but it seems it doesn't work: $image = $page->images->getRandom(); // this works $file = $page->files->getRandom(); // this doesn't I've tried pop(), first() and other functions but I believe I must be missing something. Thanks for everything.
-
That's it. Thanks for the tip Soma!
-
Googling for alternatives to Wordpress. Found it on alternativeto.net website
-
Many thanks for your support Diogo. It is working perfectly.
-
Hi! First of all, thank you for this wonderful module. I am, however, experiencing some difficulties on using it properly. I experience the same issue some users reported back in the thread but while I've tried to apply the fix, it even got worse. So, here's what happening: Anyone has any clue on what may be going wrong? Thank you!
-
I think I got it even though I really don't understand why now this is needed. Changed $class = $child === $page->rootParent ? " class='on'" : ''; to $class = $child === $page ? " class='on'" : '';
-
One more thing: I understand that the following line adds the "on" class to the menu item if the current page matches that item, however I don't understand how that works. $class = $child === $page->rootParent ? " class='on'" : ''; Could you please explain it to me? This is because I've changed pages level like this: $homepage = $pages->get("/en/"); and now the on states aren't working... Thanks
-
Perfect. Now I understand how it's done. Many thanks!
-
Greetings all, I am trying to separate which pages display on the header menu and those which appear on footer menu. For that I created two checkbox fields, applied them to the templates, and now I am trying to filter them in the menu list. Here's my code: <?php [b]$homepage = $pages->get("/")->find("visibility_in_top_menu=1");[/b] $children = $homepage->children; // $children->prepend($homepage); $i = count($children)-1; foreach($children as $child) { $class = $child === $page->rootParent ? " class='on'" : ''; if($i>0){echo "<li><a$class href='{$child->url}'>{$child->title}</a></li>";} else {echo "<li><a$class href='{$child->url}' id='last'>{$child->title}</a></li>";} $i-=1; } ?> The thing is that I am probably not setting up the first line well. Can anybody help me out? Thanks!