Leaderboard
Popular Content
Showing content with the highest reputation on 06/13/2015 in Posts
-
Welcome, justb3a and clsource, as core contributors to wireshell! We got a dedicated GitHub organization now: https://github.com/wireshell/wireshell - please update the remotes of your forks Packagist reference is already updated, to the usual $ composer global require wireshell/wireshell will work like before. The three of us are now toying around ideas how to improve wireshell, and one big feature would be if ProcessWire modules could provide their own wireshell commands (in addition to the wireshell core commands). We're not sure how to do this exactly, but maybe the PW community/module authors have ideas. Our current scenario: Besides from scanning its own /src/Commands folder for core commands (right now commands are hard-coded in /app/wireshell.php), thanks Stikki for the idea!, wireshell could search inside (ProcessWire's) /site/modules/ folder for commands provided by modules. So for example, alongside /site/modules/MyAmazingModule.module there can be a MyAmazingModuleCommand.php file (or commands, or "namespace" folder if there are more than one). The things bugging me here are a) dealing with dependencies and b) the exact details of "scanning for commands". But maybe someone could chime in here? I guess a concept of "PW module provided wireshell commands" would be a huge step forward (Drupal's drush already works this way, and makes it a really, really useful tool)3 points
-
Hey Marcus, Yes as dependency is a hell it is good to leave it to composer . And as you know installing modules is simple as composer require <vendor/packagename> The only thing to do is to keep a composer.json file for all the modules { "name": "vendor/package-name", "type": "pw-module", "description": "Your module what it does", "keywords": [ "keywords", "comma", "seprated"], "homepage": "https://github.com/harikt", "license": "BSD-2-Clause", "authors": [ { "name": "Contributors", "homepage": "https://github.com/harikt" } ], "require": { "hari/pw-module": "~0.0.1" } } and add to packagist. The only things to note in composer.json is the "type": "pw-module", and "require": { "hari/pw-module": "~0.0.1" } We are all done. Happy PhPing!2 points
-
@adrianmak - if you use the GET variables (aka query string parameters), then you can use them in a selector, once sanitized; and then use that selector to present the relevant posts. I have used that option, but now i always use segments, since i can cache those pages. i would probably only use get vars if i was maybe filtering client side, so still able to cache the page itself...2 points
-
For pages that you want to automatically direct to the first child, I would make them use a template that has this in it's code: <?php if($page->numChildren) $session->redirect($page->child()->url); If you add a new child page, and they aren't sorted by date added (descending) then the newly added page isn't likely to be the first child. If no default sort is selected, then it'll add it as the last child. So if you wanted to redirect to last page (rather than the first) then you'd want to do this: <?php if($page->numChildren) $session->redirect($page->child("sort=-sort")->url); By the way "sort" is just a name representing the order that pages have been dragged/dropped to. That's the default value if a page doesn't have another field selected as it's default sort field. The minus sign "-" in front of it represents descending sort. Without the minus sign, it would be ascending. Since you want to select the last page, that's why it's "-sort" rather than "sort". Or if you wanted to make it select the most recent page added by date: <?php if($page->numChildren) $session->redirect($page->child("sort=-created")->url); The above is also descending since most recent added would be the highest date.1 point
-
Hi. I wonder if is there possibility to limit page children to specific template. I know that it can be done in template settings. But I think it could be good option to do it in page settings. Lets say we have templates like news, gallery, author, tag, movie, song itc. We have also pages with the same names. If we want page 'Video' to accept children only with template 'video' we need to create template like 'videos-container' and set it to accept only children with template 'video'. And so on with other pages and teplates. It ends with many 'empty' templates which role is only limitation child templates in specific pages. If we could limit children templates in page settings it would be enough to have one template like 'common-container'. PS: sorry for my bad english.1 point
-
1 point
-
I believe I have setup my Github the wrong way, I get notify messages for allmost everything, but not for issues of my own repos. I haven't seen it, but will look into it now.1 point
-
Hey @marcus Regarding the module downloads, I am not sure if you noticed my earlier posts http://harikt.com/blog/2013/11/16/composer-support-for-processwire-modules/ http://harikt.com/blog/2013/11/19/composer-support-for-processwire-part-2/ That way we can install modules on the site/modules folder as we are doing with just composer. I am also missing how processwire will support composer in the future, if anyone can give some insights / links it may also help. EDIT : I am happy to change the vendor name and give to processwire if Ryan likes it. Thank you1 point
-
how did you implement the categories and tagging something like /?cat= /?tag= on the url ?1 point
-
@kathep, frontend search with filters (AFAIK) is going to be quite different than from within PW. One thing you might consider is to use a combination of jQuery DataTables with some custom select fields, perhaps a bit of Chosen Select; here's an example: http://katonahartcenter.com/pages/schedule/1 point
-
@BernhardB What do you mean on "archiving"? Only a static state (no publicly available), or a page that can be viewed on the site? If its only static, then generating a PDF or static HTML files (with all assets) isn't an option?1 point
-
Thanks Peter. I don't have a use-case now, I was just wondering how to do it. I just read the API docs and I'm starting to connect the dots. Thank you.1 point
-
1 point
-
Hi Citytech Tester, Please don't get me wrong, but I'm curious what went wrong. And probably others can learn from it to. And yes, you're free to ask more questions, preferable as you said in a new topic. You're welcome !1 point
-
Hello Martijn Geerts, I am very new to this forum. Just joined yesterday. If it is wrong to ask another question under a previous topic then i extremely sorry. I will post that question again as a new topic. Thanks.1 point
-
Cathegories...are simple by pagefields. (Even nice functions like "See also" could be just simple pagefield to select.) Easy example on a site for a diary like newssystem with use of URL segments....really great stuff for little functions like /archive/ or /2015/ or /my-cat/ just with different URL segements... Newspage: http://waldkindergarten-altfraunhofen.de/aktuelles/#start URL Segment for archive show all: http://waldkindergarten-altfraunhofen.de/aktuelles/archiv/#start URL Segment 2 for year: http://waldkindergarten-altfraunhofen.de/aktuelles/archiv/2015/#start or for cathegory name: http://waldkindergarten-altfraunhofen.de/aktuelles/archiv/ausfluege/#start every single item lives under /aktuelles/: http://waldkindergarten-altfraunhofen.de/aktuelles/unser-waldkater-2015-05-11/ (it get on creation a name + date combination) some codeexamples for URL Segments are here - this works with just a few lines of code so great, so easy, so cool...ähh sorry but in every second post i have to write how much i like PW!! https://processwire.com/talk/topic/9476-new-project-a-nice-growing-kindergarten/#entry91259 (attention - it's may not the best code but it works so far) some backend pics... I only have one single cat to choose since i use this in the isotope view to sort! best regards mr-fan1 point
-
Another small, but potentially helpful module. This fieldtype references a field in a page, where the field's data is retrieved from a somehow related remote page. It's kinda like a one way symlink to a remote field. To make this description a little easier to understand I'll just add a example. Imagine you've some pages placed all over the page-tree, but you need editors to be aware of a specific setting in a single page. With this Fieldtype you would set this up like this: - Get the page (php snippet kinda like for page fields) return $pages->get("/special-settings-page/"); - Setup template to field pairing settings=my_special_field - Add this field to any template you need this on. Now this special setting is visible in the backend, if someone edits a page with this reference field, and via the api as read-only field. The field can use all collapsed modes, which do not allow editing, so it can be hidden if it's only needed by the api. This can be useful for content heavy sites, where information is scattered around multiple (parent) pages, but maybe all information needs to be available for the children. It's also nice for creating (shorter) selectors for inputfield dependencies or dynamic page fields. More elaborate examples about this options can be found in the readme of the module. Todo Add checks to prevent infinite loops Maybe make it a field, which can be edited and saved. GitHub: https://github.com/LostKobrakai/FieldtypeReference1 point
-
I found this thread because I was looking to solve the very same problem. It does look like a new module would be needed. The "problem" that I see is that you end up with an explosion of templates "polluting" the list, where they don't do anything else than constraining what their children can be. colour colours image images member members news-item news-items region regions Double the noise, double the funk. So, I'm with @MarcinP and I might (maybe, perchance) do something about it...1 point
-
Currently there's no way to this with the core, but one could maybe write a module to implement this constraint-management. I would love to see something like this, because I do like to limit down all templates, so it's easier for the client to not break stuff.1 point