-
Posts
461 -
Joined
-
Last visited
-
Days Won
7
Everything posted by Tom.
-
Yup, it's got me pretty dumbfounded too. Maybe I will swap to using PHP's standard $session. Maybe it has something to do with ProcessWire's 3.0 compiler? EDIT: When you are logged out, this problem doesn't exist. I'm guessing when you are logged in it redirects to an admin template to enable the front-end editing the displays the page. Resulting in that else firing? EDIT2: Disabling and enabling the Front-End editing module fixed this issue. EDIT3: Disabling and enabling the Front-End editing module only fixes it for a short amount of time. EDIT4: I've created a video to better illustrate the problem I'm facing:
-
I have indeed. That still had the same problem. I've made a video demonstrating the problem I'm having:
-
Sorry, I know I'm full of questions today. However I've come across this. I want to be able to set a session that will store PageIDs for this user journey thing I'm doing. However there is only two templates I want to set the $session on, so if they visit a page that isn't part of the user journey it will reset all PageIDs. I'm using: <?php if(!$page->is("template=question|document")) { $session->journey = ''; } ?> However, this will reset on pages that belong to question or document. But the strange thing is, I tried: <?php if(!$page->is("template=question|document")) { $session->journey = ''; echo "Hello"; } ?> The header.php that this file is in, is using require. Is it possible that this: $inArray = false; foreach($journey as $item) { if($item == $page) { $prev = $journey->getPrev($item); $next = $journey->getNext($item); if($prev) echo "<a href='$prev->url' class='uk-button uk-button-small'><i class='icon-uniE171'></i> $prev->title</a>"; if($next) echo "<a href='$next->url' class='uk-button uk-button-small uk-align-right'>$next->title <i class='icon-uniE16F'></i></a>"; $inArray = true; } } if(!$inArray) { $session->journey = ''; } is firing before and returning false due to: $journey = $pages->find("id=$session->journey"); Removing this line: <?php if(!$page->is("template=question|document")) { $session->journey = ''; } ?> Stops the session from being cleared on the document or question page. However again echoing anything out from there doesn't display. I'm really confused with this one. Any help is deeply appreciated.
-
Thank you very much, that worked. I can't say I understand what's going off there, but it worked! I'll will take some time to research it and figure it out
-
Here is a difficult one for you guys. I'm wanting to do a page step sort of thing. I'm creating an online repository where everything will be relationship based. I've created a page and template that will hold "Journeys" these "Journeys" have a Journey start field and a Journey field. When a page is hit with Journey_start matched it will look at the Journey field to look at what pages should follow on to that. This is then set in a session: $journey = $pages->findOne("template=journey, journey_start=$page")->journey; if($journey->count) { $journey = $journey->prepend($page); $session->journey = (string) $journey; } What it will do from here is check if the current page is part of the session, if it isn't reset the session. This is because a page can be part of a Journey but also the start of a Journey. So if you go away from the intended Journey it will reset ready to start a new one. So once it's on the next Journey page it does the following: if($journey->count) { $journey = $journey->prepend($page); $session->journey = (string) $journey; } else { $journey = $pages->find("id=$session->journey"); } However this will return a random order and not the order the id's are set. Throwing the pagination out: $inArray = false; foreach($journey as $item) { if($item == $page) { $prev = $journey->getPrev($item); $next = $journey->getNext($item); echo "<a href='$prev->url'>$prev->title</a>"; echo "<a href='$next->url'>$next->title</a>"; $inArray = true; } } if(!$inArray) { $session->journey = ''; } Anyone got any ideas? Am I going about this all wrong? I believe if I can use $pages->find to return the pages in the order of id's set, it should work.
-
Hello, I recently came across this. However I used a very different method than the example I'm going to attempt because I was matching tags. Basically I would get a match on "Disability Act" but not "How to help with Disability". Because it was looking for something that contained all the connectives "How to help with" however as the search engine, I was only interested in the "Disability" part. For this I would try (please bare in mind I don't know the templates/fields): $selector = ""; $search = explode(" ", $input->get->search); foreach($search as $result) { $selector .= ", (field1|field2=$result)" } $pages->find("template=skyscraper" . $selector); However this wouldn't take put the result higher up if it had "Thomas" in the address and the area as "NYC" it would pick one and return results based on that. I would love to know how to do the search based on most matched phrases. However I have no idea how to do that. Maybe someone far smarter than me could tell you how to do that in ProcessWire
-
Using $page->find("field%=value") Where value is inside an array?
Tom. replied to prestoav's topic in General Support
I must apologise, I haven't used the ProcessBlog module. However I'm guessing the blog_categories are a page field? If so you could try $posts = $pages->find("template=blog-post, limit=6, blog_categories.title%=$page->title"); -
Happy New Year everyone! I too welcome another fantastic year with PW and the ever growing community!
-
MERRY CHRISTMAS for all those who celebrate it! Here's to another awesome year with ProcessWire
-
"Come to think of it, it might be nice if PW just did this for you automatically when it detected the condition... but we don't know what the ft_min_word_len setting is. " +1 This would be awesome. Ryan, you'll have to let me buy you a drink - (Do you have PayPal?)
-
Thank you very much Ryan, this much appreciated
-
Hello, I'm just having a little trouble with the search functionality with ProcessWire. I have a title "Disability Discrimination Act" and I have the search: However, searching "Disability Act" doesn't bring a result, however searching "Disability" or "Act" does. According to the documentation, this shouldn't be the case? $search = $input->get->text("search"); if($search) { $search = $sanitizer->selectorValue($search); $results = $pages->find("template=document, title%=$search"); } else { $error = "Please enter a search term in the search box above."; } I'm using ProcessWire 3.0.2 - If it's a bug? EDIT: Figured it out, but it's still pausing a problem I understand that %= is more like *= (exact phrase) rather than ~= (contain phrase). I would use ~= but it fall just short of the 4 letter minimum. EDIT 3: Using "~=" searching the Title exactly "Disability Discrimination Act" - Returns nothing, searching "Help with disability" returns the right result. However searching "Help with disability act" returns nothing. - Still confused Would the use of a 3 letter word cancel the search? - Is there a way of searching like %= but acting like ~=
-
I completely agree with LostKobrakai, however to answer your question I would do the following: <ul> <?php foreach($page->menus as $item) { $prev = $item->prev->depth ? : 0; $next = $item->next->depth ? : 0; $depth = $item->depth; $count = $depth - $next; echo ($prev < $depth ? "<ul><li>" : "<li>") . "<a href='{$item->menu_page->url}'>{$item->menu_page->title}</a>"; if($count == 0) { echo "</li>"; } else if($count > 0) { for($c = 1; $c <= $count; $c++) { echo "</li></ul>"; } echo "</li>"; } } ?> </ul> I've just tried to come up with this from my head, so it might need a little tweaking. EDIT: Updated based on Macrura's notes.
-
Hi Peter, I actually like the way it works at the moment. On the default theme - Pages goes to the Tree and also Pages > Tree goes to the tree. Usability wise, once you get use to how clicking pages goes to the tree, it actually feels weird that Pages > Tree. Most submenus take you to a new UI, so some users might believe that the page isn't loading. However in Reno theme it made sense to have Tree because the top level isn't clickable (well it is with a double click, but that isn't immediately obvious to users). For now I think un-hiding the tree makes the most sense rather than re-adding it as while Reno has done an amazing job with the theme and it's the choice of most people. It isn't default. Thank you very much Keep up the great work Tom!
-
Ryan has already announced that PageTable are to be favoured over repeaters and that repeaters won't support conditional logic. However I find that repeaters still have their place. In this example I have a slider that will support both image and video. In the slider there will be no content, it's purely visual. This means I have no need for a title field, and I only have three fields an Option (Image, Video) and the Image Input field and the Video Input field. Each one is using conditional logic to display based on the Option field. I know you can use a PageField with the template - Image and the template - Video and get the page name to be the date-time to bypass the need to enter it. However this doesn't seem as user friendly for the general user. Maybe I'm missing something with PageFields, I just find in this case a repeater will be much more user-friendly. At the moment if you have conditional logic in a repeater, the field just doesn't save. This feels like a bug. Should there be a notice that makes it obvious that the conditional logic will not function inside a repeater? What do you guys think? I look forward to hear your suggestions.
-
This is a little out of my technical know-how so I'm completely guessing here, but I would say the reason the html isn't printing is because you have set the content-type of the document to application/javascript or application/json. Also $users is a variable that should only be used in context to the ProcessWire API. http://cheatsheet.processwire.com/ You don't need $users = $pages->find() ... foreach($users as $u) should just work on it's own.
-
Wow... Processwire seems to be the CMS I have always wanted..
Tom. replied to Zislatik's topic in Getting Started
Welcome aboard, 1. We have plenty of converts here. Myself I'm a WordPress convert. However I'm not a convert from MODX so I will not be able to tell you the differences. 2. ProcessWire does not alter any of your markup and only when using ->render() will you find it output markup. With the new front-end editing it does alter your markup but only when logged in with the permission to edit using the front-end. The HTML, CSS and Javascript is completely down to you. By default ProcessWire uses PHP as it's template engine. So the only thing you need to learn is API and that's it Oh yeah, and the API is super easy to learn. Trust me ProcessWire is a front-end developers dream. 3. I work at an agency but also freelance. While I don't charge much at all for freelancing as my job is my hobby. ProcessWire is always my CMS of choice. So I guess you can say I make a living out of ProcessWire. -
Hi, copy and pasting will often try and carry it's formatting. I'm going to assume you are using CKEditor when pasting in? There is an option to remove formatting when pasting it's a clipboard with a [T] next to it. To fix the a tag problem, Ryan fixed this in update 3.0.2 - https://processwire.com/blog/posts/processwire-2.7.2-master-and-3.0.2-devns/ If you find this problem still exists, please report it on github
-
<?php foreach($page->children as $child) { echo "<div class='my-class'>"; foreach($child->images as $image) { echo "<img src='$image->url'/>"; } echo "</div>"; } ?>
-
Page Tree not visible in Backend after Installation
Tom. replied to julian-schaefer's topic in General Support
I believe it's hidden by default because "Pages" also took you to the page tree. This means on the default theme you have Pages and Pages > Tree going to the same place. I can see how Ryan saw this as confusing for non-technical users. However with Reno Theme you can't single click on the top level menu item, causing this problem. You can double click Pages to get to the tree, however I recommended: https://processwire.com/talk/topic/7625-reno-theme/?p=108089 -
This is a complete guess, but since the actual edit links have an ID for example pw-edit-1, are you able to apply a CSS z-index using: #pw-edit-1 { position: relative; z-index: 999; /* Probably something less ridiculous ***/ }
-
Hi, I've hit this problem before. I started out as WordPress developer. WordPress is immensely popular to the point where plenty of clients think WordPress = CMS. If you mention another system they will think "they wont be able to edit it". WordPress is very much do-it-yourself and plenty of clients like that. However working in an agency it's a nightmare. You will find that they always break things, or use dodgy shortcodes and your often trying to provide support. When building a bespoke website in WordPress, I often used ACF to make sure it was locked down, no Visual Composer to play around with elements. But all it gave me was headaches. The API is allover the place and not to mention each plugin has it's own set of functions you have to worry about (WooCommerce). I've been using WordPress for years and I'm still always searching stuff like "How to get category image as thumbnail size", which turns out you have to call about 20 functions and pass it through the eye of sauron before it spits out just a url with the image size. With WordPress there is no guessing. ProcessWire I learnt the rules of the API and from there, I could guess how to do things and often it worked! This is a signature of a system that works for you, and not you having to work for the system. jQuery is a lot like this and the reason I love jQuery, I know I get the with .width() so the height should be .height(). Simple. So that's everything my side, how about the clients? Well, I always found convincing clients was very easy when the subject of security came up. I often tasked them to find a hacked ProcessWire site, then do the same for WordPress. Obviously we knew who the clear winner were there. After that is speed. All my ProcessWire sites run lightning fast. But I just think morally it's better to go with ProcessWire. WordPress is now taking up roughly about 20% of the web, this calls for a very unsafe web. That's 20% of websites with known vulnerabilities coming out almost every week. It's got so bad, Google now scour websites and report hacked sites on their search results. ------- Here is an example we had recently; A potential client came in thinking he had an audience of about 30,000 per month. He was using his cPanel's analytics and always went off those. He decided with that amount of viewers he should invest in marketing. We hooked up Google Analytics to see demographic, page views, user journey etc. to discover he was only getting 2,500 per month. After accessing his analytics we found that he had 27,500 hits per month to /wp-admin/admin-ajax.php
- 9 replies
-
- 10
-
-
Thank you very much for your great work Ryan. Also your explanation was very helpful. That's exactly where my confusion laid, I suspected it was a bug