-
Posts
6,629 -
Joined
-
Last visited
-
Days Won
358
Everything posted by bernhard
-
i think the superuser name is much better than webmaster: https://en.wikipedia.org/wiki/Superuser and i think once you got some experience using permissions everything should be quite clear. i think my learning curve was: create an editor role assign page-edit permission try to edit a page... why does it not work? ah, i have to set the permission on the template level (meaning i can control it on a template level) ah, i can inherit to all child pages done i think that's not too hard for someone wanting to work with user permissions
- 14 replies
-
- 2
-
-
- admin
- permissions
-
(and 2 more)
Tagged with:
-
just add the "pw-panel" class to your link. if you want it to reload on every open add "pw-panel-reload". see here for details: https://github.com/processwire/processwire/blob/master/wire/modules/Jquery/JqueryUI/panel.js
-
you are right! thanks. than that's of course not possible. didn't think of that since i always updated my modules through git pull... so +1 for /site/assets/TracyDebugger/snippets agree
-
not if the folder is empty and excluded from git. or am i wrong here?
-
i prefer to have a dedicated folder for code snippets inside the modules' folder ( /site/modules/mymodule/snippets ). it's simple to implement, it's simple to work with and it's simple to communicate! think of the difference that ready.php made to hooks. any newbe can easily add hooks to the system by some help in the forum "just put this into the /site/ready.php file..." a configurable option is nice to have but needs more config for the dev (applying the correct settings to the module compared to just placing a file in the right folder) and also for communication in the forum ( place the file wherever you like, set the correct path in the module, with or without trailing slash, relative to xy... ). but i had this discussion with @kongondo regarding his runtime markup field and "lost" (using my own render method), so maybe i'm alone with that opinion...
-
the latest weekly.pw had a survey about that topic: i'm on self-managed VPS using plesk as controlpanel. current pricing is 15€ for 2core / 4GB / 150ssd / 10 domains or 30€ for 4core / 8GB / 400ssd / 30 domains i tried several other options over the last months ( digitalocean self managed, cpanel, laravel forge, serverpilot ) but i came back to vps + plesk because it is quite easy to use (for me as a non expert) but also offers a lot of freedom if you need advanced stuff (having full ssh access). all the other solutions where always lacking some parts and would have made another service necessary (like backups, for example). looking forward to hearing other experiences
-
it's just too easy to create them
-
PW3 - Adding Category Posts Count to Sidebar
bernhard replied to ridgedale's topic in General Support
when you put variables in selectors you need to use double quotes! otherwise php will use $var as regular string and not as a variable. // this does not work $pages->find('categories=$cat') // this works $pages->find("categories=$cat") edit: just saw you have some more code... // change this echo "<li><a href='$cat->url'>{$cat->title} {$pages->find('categories=$cat')->count}</a></li>"; // to something like that echo "<li><a href='{$cat->url}'>{$cat->title} " . $pages->find("categories=$cat")->count . "</a></li>"; -
does that tip help?
-
you know my dummy data module? showing (random) dummy data on the frontend would be as easy as that: echo modules('RockDummyData')->getDummy()->loremipsum; you would have to provide loremipsum text in the file loremipsum.txt in that case. and it does not support parameters like number of words or paragraphs but that could easily be added.
-
I'm totally happy with the console as it is now usually I'm a fan of having everything in my IDE, but I just don't use the console that way... I'm not really against changing it to a file-based system - just stating that it is not necessary for me.
-
if i understand him correctly this would still not be what he wants, because it would also find this page: title = the red island body = three dogs lived happily... i guess it should NOT find this page? i think proper searching is beyond what can accurately and easily be done with selectors. one forum member recently linked to this search service: https://www.algolia.com/product that is free until 10k records and 100k operations. google custom search could also be an option: https://developers.google.com/custom-search/ and last but not least we have the elastic search module that looks like it could match perfectly for you. i've never used it though, so it would be nice to hear some experiences from others: https://modules.processwire.com/modules/elastic-search/
-
sometimes it can be a little tricky, that's true. but usually it is not. do you know the rendernav function of the default site profile? /** * Given a group of pages, render a <ul> navigation * * This is here to demonstrate an example of a shared function and usage is completely optional. * * @param array|PageArray $items * @param int $maxDepth How many levels of navigation below current should it go? * @param string $fieldNames Any extra field names to display (separate multiple fields with a space) * @param string $class CSS class name for containing <ul> * @return string * */ function renderNav($items, $maxDepth = 0, $fieldNames = '', $class = 'nav') { // if we were given a single Page rather than a group of them, we'll pretend they // gave us a group of them (a group/array of 1) if($items instanceof Page) $items = array($items); // $out is where we store the markup we are creating in this function $out = ''; // cycle through all the items foreach($items as $item) { // markup for the list item... // if current item is the same as the page being viewed, add a "current" class to it $out .= $item->id == wire('page')->id ? "<li class='uk-active'>" : "<li>"; // markup for the link $out .= "<a href='$item->url'>$item->title</a>"; // if there are extra field names specified, render markup for each one in a <div> // having a class name the same as the field name if($fieldNames) foreach(explode(' ', $fieldNames) as $fieldName) { $value = $item->get($fieldName); if($value) $out .= " <div class='$fieldName'>$value</div>"; } // if the item has children and we're allowed to output tree navigation (maxDepth) // then call this same function again for the item's children if($item->hasChildren() && $maxDepth) { if($class == 'nav') $class = 'nav nav-tree'; $out .= renderNav($item->children, $maxDepth-1, $fieldNames, $class); } // close the list item $out .= "</li>"; } // if output was generated above, wrap it in a <ul> if($out) $out = "<ul class='$class'>$out</ul>"; // return the markup we generated above return $out; } another hint that may help: sometimes it is a lot easier to use the has() method to check wheter to append an active-class or not. for example: // create a pagearray that has all the parents of the current page + the page itself, but not the homepage (id=1) $active = $page->parents('id>1')->append($page); // loop all items foreach($menuitems as $item) { // set menuitemclass active if the current item is part of the "$active" pagearray $cls = $active->has($item) ? 'active' : ''; // echo the item echo "<li class='$cls'><a href='{$item->url}'>{$item->title}</a></li>"; } ...would make the code much more readable than a lot of if-statements. also recursive functions help a lot to make the code cleaner.
-
ok, sorry, this was what came to my eyes at first glance... does not sound as if this was the best solution (as you said) but if it works...
-
just replace your find() with a count(). find() returns an empty pagearray so the IF statement is TRUE:
-
great to hear that hm... what do you think of splitting it into 3 parts: some kind of advanced pw-installer a process module to handle multisite installations a single php file that grabs the pw-installer similar to the online installer from soma (https://github.com/somatonic/PWOnlineInstaller/blob/master/grabpw.php) hm... thinking about point 3 i'm not sure if that makes sens, but i'll leave it here for discussion. maybe it would be easier to do a git clone kongondos-great-pw-installer than creating an index.php, copying some lines of php that basically would do the same as my mentioned git clone?! what do you think? i think it would be great to make the installation process as easy as possible and on the other hand more flexible than the one we already have (yes, i know we already have site profiles and whoever likes them please continue using them ). so if the installer was able to install a list of modules it could also install point 2 of my list! i also think that this installer should be able to load standard setups of a pw-site from any url. be it a json file or some php-setup like abdus mentioned - don't know what would be better. but imagine an installer with one inputfield at the top that says: this would make it possible to save your own basic pw-setups as simple gists share setups with others (eg on the forum for debugging, similar to the concept of VMs) and all you would have to do was to put in an URL form the basic setup (that the browser should remember), choose admin username + password and database connection info. done maybe a lot of what i want is already doable by adrians module toolkit? but still i think the process of installing pw in general can be optimized. or am i just missing some great options we may already have (like wireshell for example)? or can we use composer like this?
-
exactly what i was talking about here: see also @abdus comment on top of page2 i don't like site profiles. i think they are far too unflexible mostly because of the reason kongondo said. a possibility to define modules that get installed by default would be great! maybe this module could be extended to a kind of advanced PW installation kit? for example it could also be nice to use it to install a single-site setup in a different directory on the server (in other words, having the possibility to choose wheter the new site should be installed as single or as multisite). it would also be easy to choose the core version to use for single-site setups by defining the URL like this: https://github.com/processwire/processwire/archive/3.0.36.zip or that https://github.com/ryancramerdesign/ProcessWire/archive/2.7.2.zip thanks for creating and sharing this module with us kongondo!
-
so why do you do that?
-
two options come into my mind: hook into the buildform method, get the field and modify the available options modify the dropdown via javascript (at least sorting should be very easy like this - maybe also hiding different options, depends on your usecase and setup)
-
what is the exact usecase? are you talking about changing the template after the page was saved? or are you talking about the process of adding new pages, where you want to limit + sort the selectable templates?
-
FieldtypeHandsontable: Excel-like Inputfield
bernhard replied to bernhard's topic in Modules/Plugins
2 ideas: do you need INPUT in those tables? otherwise datatables would maybe be a better fit: https://datatables.net/examples/basic_init/complex_header.html there is also my datatables module that makes it very easy to create those kind of tables. nested headers is a PRO feature of datatables: https://docs.handsontable.com/pro/1.4.0/demo-nested-headers.html have you been talking about this feature? -
FieldtypeHandsontable: Excel-like Inputfield
bernhard replied to bernhard's topic in Modules/Plugins
would be nice to hear some details about your usecase and why you need merged cells -
LoginRegister customisation
bernhard replied to The Frayed Ends of Sanity's topic in General Support
hi @The Frayed Ends of Sanity and welcome to the forum, of course you can change it! the easiest would be some css: #LoginRegisterForm > h2 { display: none; /* or */ font-size: 14px; color: red; font-weight: normal; } you can also hook into buildRegisterForm() and remove the description of the form. you can also add a markup inputfield to your form for any other HTML you need. or you can modify the markup on the client side via JS (of course that would not be the cleanest solution but sometimes easy fixes have their place...) -
hi @svsmailus and welcome to the forum! totally agree! sounds like you'll like PW if i was you i would create one simple project (personal website, or something for a friend) and then decide if you like it or not. as you can see the community here is great and always offers a lot of very useful help. pwired already linked to the hello worlds planet tutorial that i would also recommend as first step. after that i would continue to the blog-post of markup regions ( https://processwire.com/blog/posts/processwire-3.0.62-and-more-on-markup-regions/ ) this post shows a new and easy to understand way of the two main output strategies: direct output (like in the planets tutorial) and delayed output (that offers a lot more flexibility). edit: sorry, early submit - wrong shortcut ^^ 2 general tipps for having fun with processwire: 1) use google to search the forum: i use this approach to search content inside the forum typing "pw my search keywords" and the api by typing "api maxSize()" 2) read through all the blog posts as there are plenty of useful informations around 3) subscribe for pw weekly newsletter 4) read the forum and learn from others 5) have fun