-
Posts
11,185 -
Joined
-
Last visited
-
Days Won
372
Everything posted by adrian
-
Hi everyone, New version committed to the dev branch which adds some interesting new features. I have had some clients confused by the use of child pages for repeatable elements. I know we have PageTable, but a couple of versions ago in BCE I introduced the ability to embed the editor within the Content tab (or a new tab, etc). This provides an alternate interface for editing child pages within the parent page. I think this was useful (and has become my default over PageTables). It can be especially cool in Lister mode where you can have inline ajax editing of child pages. This new version adds the ability to hide the child pages from the Page Tree and and also if you want, to hide the Children Tab. This means that clients have no idea that the content is stored in child pages. I know that you can also do this with an external page tree for PageTables, but that hidden "black box" still makes me a little uncomfortable at times, so this is a bit of a best of both worlds. The only catch with the hiding of child pages in the Page Tree is the count of child pages. To make it work I needed to make the core Page::numChildren method hookable. I have asked Ryan if he'd be willing to do that in the core, but for now if you want this feature to work properly, you will need to make this change yourself. Here are some screenshots of the new options and functionality. Two new settings: Note that the About page has no children listed: Child pages are editing within the content tab, but nowhere else because the Children tab is also hidden:
-
Have you seen Martijn's great module: http://modules.processwire.com/modules/admin-custom-files/
-
for new project, is it safe to use latest pw 2.6.x dev version ?
adrian replied to adrianmak's topic in Getting Started
2.6.1 is the stable version, but 2.7 is due out in about a week, so for a new project I would definitely say go with the dev branch (https://github.com/ryancramerdesign/ProcessWire/tree/dev). Just don't use the devns branch yet - it will be the 3.0 version down the road a little! -
I decided to have a look around and discovered the problem is that the rebuildForPage method is not being called when a new page is added. This fixes it for me (note the addition of !$page->created): } else if(count($changes) || !$page->created) { $this->rebuildForPage($page); }
-
True enough - it depends on how you are looping through the child pages. Perhaps something like this: foreach($page->children() as $dam) { echo $dam->country->title; }
-
I think you are using a pagefield called "country in the dam template. If so, then: $page->country->title
-
I have a similar (I think) issue to soma - I need to restrict a role to only be able to edit all pages in one branch of the page tree. Initially it looks like this module makes very easy work of it, but what happens when a new page is added to the page tree - the index is not rebuilt, which means that the new child page won't be editable by the dynamic role. At the moment it seems like the only fix is to open this module, change one of the selectors, save, then change it back to what I want and then save again - then the new page is added to the index of pages that are editable by the dynamic role. Am I missing something?
-
List of PW modules on Packagist: https://phppackages.org/s/processwire https://packagist.org/search/?q=processwire Makes me wonder - should all module authors be submitting their modules to this list, especially now that PW 3.0 will have composer support?
-
I just tested Macrura's group approach and it works for me on an ImageExtra field. It's modified slightly to match the fields/templates I have in my current sandbox install. I can't imagine why CroppableImage would affect this. $q = 'testtag'; $matches = $pages->find("template=home, (title|first_name|body%=$q), (images.tags*=$q), limit=150"); foreach($matches as $p) { echo $p->title; } What happens if you strip it down to the basics, like this: $q = 'testtag'; $matches = $pages->find("images.tags~=$q, limit=150"); foreach($matches as $p) { echo $p->title; } Also, try putting this as is in a template file to make sure nothing is going wrong in getting $q to the selector. Of course you could also just echo the value of $q in your search template as well, but you see where I am headed
-
Could you post a list of the modules you have installed on the site that is having the problem. A quick glance might give us a clue of where to look.
-
Getting template specific field properties within the API
adrian replied to wheelmaker24's topic in API & Templates
This post shows how: https://processwire.com/talk/topic/5610-field-template-context-on-frontend-forms/ -
How to include Home into the navigation - Blue VR Site Profile
adrian replied to L. Leopold's topic in Themes and Profiles
Ok, so in the Blue VR Site Profile take a look here: https://github.com/gayanvirajith/BlueVrSiteProfile/blob/master/templates/_done.php#L84 This is where menu functions are being called. Try replacing that one line with this: $homepage = $pages->get('/'); $children = $homepage->children(); // make 'home' the first item in the navigation $children->prepend($homepage); echo renderTopNav($children); Untested, but I think that is what you need in that situation.- 4 replies
-
- 2
-
-
- navigation
- blue-vr
-
(and 1 more)
Tagged with:
-
I completely agree - I think it would be more targeted and efficient that way, although I am guessing he probably won't want to bother with the str_replace option I just introduced. My need for that is probably an edge case though
-
Just made some changes to the gist. It now uses square brackets [ ] and not curly braces {} It now limits replacements to just description and notes paragraphs You can now define str_replace $search and $replace like this. In this example I needed the dashes in $page->name replaced with underscores, but you can use however you want. [page.name.(-|_)] Not sure that my code/regexes are the cleanest - I needed this is a bit of a rush, but it seems to work well and I am really finding this very useful in many of my fields. I'd definitely be keen on hearing feedback from anyone else who tries it and if you think it warrants being included in the modules directory. I think I will likely use it on most new sites, but maybe it's just me
-
How to include Home into the navigation - Blue VR Site Profile
adrian replied to L. Leopold's topic in Themes and Profiles
There are many different ways to do this, so without seeing your code, it's hard to know what would work best to match what you have, but take a look at this: https://github.com/ryancramerdesign/ProcessWire/blob/cffb682836517065d7dd7acf187545a4a80f1769/site-beginner/templates/_head.php#L21 See how the homepage is prepended to $children so that when it is foreach'd it will be included. Does that help?- 4 replies
-
- navigation
- blue-vr
-
(and 1 more)
Tagged with:
-
Searching for a fieldtype / inputfield example module
adrian replied to pwFoo's topic in General Support
Ryan wrote this one: http://modules.processwire.com/modules/fieldtype-events/ as an example / starting point for writing your own fieldtype/inputfield. Of course there are others in the modules directory as well that you can steal from- 2 replies
-
- fieldtype
- inputfield
-
(and 1 more)
Tagged with:
-
Do you really need to modify CommentList.php ? What about the "OPTIONAL: Generating your own output" section on this page: https://processwire.com/api/fieldtypes/comments/ If you really do need to modify, take a look at this blog post: https://processwire.com/blog/posts/processwire-core-updates-2.5.14/
-
Hi @justb3a, Just noticed a bit of a critical bug. If you remove one of the "Add other text input fields" the field/column is not removed from the DB. This results in a fatal error and the images uploaded to the field are lost. You have to manually edit the DB table to remove the fields to get things working again. As a wishlist item, I'd love to see the ability to add select, radio, and checkbox fields as well as plain text
-
Just committed a small update that makes use of image-picker (http://rvera.github.io/image-picker/) for selecting the poster image which is much cleaner than the ugly radio buttons I had before! Thanks to @BernhardD and his TemplatePreviewImages module for the inspiration.
-
Content type of field to store Google Analytics code
adrian replied to biotech's topic in General Support
Please take a look at this old thread: https://processwire.com/talk/topic/552-i-get-the-404-page-when-editing-home-page/ Firstly try turning on debug mode, but also please check to see if your host is running Apache's modsecurity - seems like it might be the issue. Note in particular the last comment on that thread - maybe you should contact @jlahijani to see if he found a solution as he was also using a <script> tag. -
Why aren't all browsers (and Android/iOS apps) supporting SVG icons ? Looks like Firefox already does and Safari is heading that way: http://caniuse.com/#feat=link-icon-svg Maybe the others will follow and all this icon sizing mess can be a thing of the past! EDIT: Some discussion regarding SVG icons in chromium: https://code.google.com/p/chromium/issues/detail?id=294179
-
Content type of field to store Google Analytics code
adrian replied to biotech's topic in General Support
So to clarify, if you don't put any JS code in the texarea then the you see the proper edit page for your homepage? Maybe it's hard to tell now - I am assuming you can no longer edit the homepage at all to even remove the JS code? -
Content type of field to store Google Analytics code
adrian replied to biotech's topic in General Support
Do you mean Content Type: "Unknown" ? Are you using a regular textarea Inputfield type, or CkEditor. It works fine for me with a regular textarea. -
Copy pages (and children) from one site to another
adrian replied to manlio's topic in Getting Started
Hi manlio - I am sorry I haven't gotten back to your PM yet - work and life has been a little hectic this last week. I really hope I can have a good look at your PM and sort out your Migrator issues sometime in the next week. I hope that timeframe will be ok. Again, sorry for the delay! -
I don't have the option currently to exempt a particular language, but would be happy to add if that helps. But perhaps the better option would be to figure out a way to prevent the problems you are experiencing when greek is being renamed. Can you provide more details on exactly what is going wrong?