Jump to content

wesp

Members
  • Posts

    13
  • Joined

  • Last visited

Profile Information

  • Location
    Cologne, Germany

Recent Profile Visitors

650 profile views

wesp's Achievements

Jr. Member

Jr. Member (3/6)

1

Reputation

  1. Hi @virtualgadjo Thats actually good to know that its that easy for the multiple select fieldtype. But I am actually building a backend to be used by the client and am searching for a more intuitive approach here. To be able to sort the selected pages I am also using AsmSelect as the input field type and for that your hack isn't working. But thank you anyway ?
  2. Hi all, Is there a way to add all selectable pages at once to a page reference field (via a button click or as another selectable option)? Thanks for any help!
  3. @dragan thanks for the info, I will look into that!
  4. @dragan maybe you can also help with another issue I have since it's a very similar thing but for a different website: I have a one-pager with the children pages being rendered as sections with their own template file, each section has the $page->name as id so I can link to them as anchor links. The case here is that I'd like the links to not have the hash symbol, so that mywebsite.com/section1 acts like mywebsite.com/#section1 but doesn't look like it. I tried doing the same for this as what worked with hiding the parent pages from the url, modifying it a bit because of the multiple templates, but i am at a loss if that even makes sense to try to do here, because that didn't work.
  5. @dragan that did the trick, thanks!
  6. Hi @Zeka thanks for the fast reply! I made sure to do that and at first it then gave me this error: After putting $config->useFunctionsAPI = true; inside the config.php it still doesn't really work, as in the links look right and clicking them does redirect me to a new page but that page is completely empty and not rendered via the template file article-page
  7. Hi everyone, My setup is that I have a page tree like home = articles == article-1 == article-2 On the home page I link to the individual articles and I'd like the url to be page.com/article-1 instead of page.com/articles/article-1 I guess this is a kind of old topic, because I want to achieve the same as in these: so far I've tried putting either one of the following hooks into the _init.php: $pages->addHookAfter('Page::path', null, 'hookPagePath'); function hookPagePath(HookEvent $e) { $page = $e->object; if($page->template == 'article-page') $e->return = "/$page->name/"; } $pages->addHookBefore('Page::path', function($event) { $page = $event->object; if($page->template == 'article-page') { $event->replace = true; $event->return = "/$page->name/"; } }); and they both actually work in the way that the links on the home page do and look like I want, but when I follow the links they just redirect me to the home page again. As in they don't even throw a 404 anymore when I put in some random letters in the url, I always get redirected to home. And that seems to be caused by allowing URL Segents in the home template, because if I uncheck it I get 404s when following the links. I don't quite get how to work with this as in all other forum topics no one else seems to have had that problem, so any help is much appreciated!
  8. Hi all, Is there a way to automatically add new pages to a page reference field? My goal there is to create some kind of sortable index list of all pages sharing the same template, without having to manually select them. I know that it's possible to define which pages are allowed to be selected via the Fields own Input settings, but this still leaves me with having to go into the page and select each possible page to reference by hand instead of being able to have them all added to the list at once and/or immediately when they are created. Thanks in advance!
  9. Ok I found this codepen: multiple sortBy and through rearranging and cleaning up my code a bit, as well as making the sort order static and not changeable via a page field this sortBy: ['featured', 'date'], actually works, where the items get first sorted by the value of featured and if that is the same they get sorted by date.
  10. yes that works!! thanks the => command was what I was missing, I had actually tried to get the $key with a bunch of other commands and didn't know about this one
  11. Mainly in the frontend, but both would actually be nice, if that's possible
  12. Hello everyone, Is there a way to access the key number of an item in a page reference field and then output it as a value? So for example I want to automatically output the number 1 if the referenced page is the first in the list and have it be updated when the list is reordered via drag and drop. Thanks in advance!
  13. Hello everyone, I am struggling a little bit with combining Isotope with Processswire. The functions themselves work nicely and I managed to give the sortable items their categories via a page field and now I also want to make the sort order manageable with a field instead of on the actual site, so the client can easily set the way they want their stuff ordered. I am using a Select Options Field and am giving the sortable elements an extra class with that, and that does actually work, looking like this: <h2 class="headline_article<?php if ($home->sortPreviews->value == "headline"){echo " is-checked";}?>"><?php echo $article->headline; ?></h2> The only problem I have is that for the headline I want the sort order to be ascending, but for the date I want it to be descending, and as far as I know with my 1 month of coding knowledge I can only set it as either or in the grid defining javascript. Which now basically looks like this: var $grid = $('.grid').isotope({ getSortData: { selectedCategory: '.is-checked', } }); $grid.isotope({ sortBy: 'selectedCategory', sortAscending: { selectedCategory: false, } }); is it possible to either check if the item that now has the class "is-checked" also has the class "date" and then to set the sort order to descending in that case while in any other it should be ascending? Or if not is there maybe a different way to approach the whole idea? Any help is much appreciated!
×
×
  • Create New...