Jump to content

Jan Romero

Members
  • Content Count

    331
  • Joined

  • Last visited

  • Days Won

    5

Jan Romero last won the day on March 9

Jan Romero had the most liked content!

Community Reputation

492 Excellent

About Jan Romero

  • Rank
    Sr. Member

Profile Information

  • Gender
    Not Telling
  • Location
    Germany

Recent Profile Visitors

13,961 profile views
  1. Mh, following the 4 steps from the blog works fine for me on 3.0.172 (in fact, i believe step 2 hasn’t been necessary for a while). Can you confirm that the config takes by putting var_dump($config->pageNameCharset, $config->pageNameWhitelist); into a template somewhere? Btw, just uncommenting 16B in .htaccess won’t do. You must also disable 16A.
  2. Hi @fruid. I’m not going to get into this fully right now, just some suggestions. Most importantly: What you really want to do is just buy FieldtypeTable. It’s dope, trust me. Secondly, do yourself a favor and install Tracy. I have no idea how that error came about, but the stack trace will help you figure it out. If you can’t get it to work, I suggest starting a separate thread with specific questions and code snippets and Tracy traces. Your project is kind of out of scope for Bernhard’s tutorial here 😉 Well, you’re trying to make a Multi-Field (extend FieldtypeMulti), which is a little more of an endeavor than a single value field. Lastly, you can name a hook’s $event argument anything you want, if that is what you mean. $event is kind of a convention, but you might as well use $e or $hook or $args or whatever. You can even just leave it out if you don’t need it. Hooks work with callback functions. That is to say, it’s your own function. You name the function itself and its arguments.
  3. Nice stuff, I’m definitely going to try some of these 😁 What’s the smiley little guy who is sometimes a sofa? Maybe add a title attribute?
  4. No, the values are not imported. It only connects the Fields of the chosen Template to the current Template as well. A Field can be used by multiple Templates. For example you might have a website that showcases a lot of products and also has a blog. For this you could make a Template “product” with Fields for price, dimensions and so on, as well as of course a Field called “title” and a textarea Field called “body” for the product name and a description. Now in your “blog” Template you could use “title” and “body” as well. You can even change some Field settings depending on the Template.
  5. Hi @Marvin, you can definitely have all kinds of relationships between pages in ProcessWire. The term “Page” is slightly misleading because it can imply a close connection to a web-page in your front-end. Instead, in object-oriented terms, you can think of pages as objects and templates as classes. To model the relationships between pages you can use page fields and the hierarchy of the page tree (a page will always know its children and parents).
  6. I’m only aware of this term in the realm of UI design. If that’s what you mean, ProcessWire will not get in your way implementing such a user interface, since it’s very output agnostic. It’s not clear to me what you’re trying to do. Do you mean this? https://en.wikipedia.org/wiki/Single_Table_Inheritance ProcessWire’s data model doesn’t involve inheritance, if that’s what you mean? You can get a pretty good idea of PW’s database strategy by looking at the tables of an existing PW installation.
  7. Jan Romero

    Webwaste

    this is why I for one only make websites that no one is ever going to look at anyway.
  8. yeah, the module LanguageSupportPageNames offers this in the module settings.
  9. Ticket vendors often temporarily reserve the space as soon as it’s added to the cart. You could use that to count towards the occupied spaces and remove the reservation if the transaction isn’t finalized in time. For example you could store the time of the reservation and to calculate availabilty subtract completed bookings as well as reservations younger than 15 minutes or so.
  10. Store the bookings themselves, then subtract the amount of bookings from the available spaces on the fly. Don’t store a single constantly decremented/incremented number!
  11. Yeah, the documentation is kind of buried: https://processwire.com/api/ref/page-render/render-page/. I don’t even know how to get there, really. The PageRender class doesn’t show up on the API frontpage at all…
  12. If you use $myPage->render() you can use the options array: echo $myPage->render(['lol' => 'dongs']); /////// then on $myPage’s template ///////// echo $options['lol']; Or you could just add the property to the Page object: $myPage->set('lol', 'dongs'); echo $myPage->render(); /////// then on $myPage’s template ///////// echo $page->lol;
  13. You can do that with hasChildren() just like you proposed, but you have to get the grandchild first. If you want to get the first child of $page and then the first child of that, and then check if that has children, you can do $page->child()->child()->hasChildren(). You can also put selector strings between each of the parentheses to only get specific children. Yeah, I’m pretty sure this should work: $pages->count("has_parent=$child, template=tops|tops2, projekt_top_vermietet=1") If you already know there aren’t any other templates under $child, you can just remove the template selector entirely.
  14. You mean like this? Use this very hackish hook and replace the word “tabcontents” with the name of your FieldsetPage field: $this->addHookAfter('ProcessPageEdit::execute', function(HookEvent $event) { $event->return = $event->return . '<script>document.querySelector("#wrap_Inputfield_tabcontents > label.InputfieldHeader").remove();</script>'; }); Might want to only apply it to certain templates, too, but whatever. Sorry, I couldn’t find an easy way to remove the element from the output directly, but this should be fine.
×
×
  • Create New...