-
Posts
10,902 -
Joined
-
Last visited
-
Days Won
349
Everything posted by adrian
-
General Question on how to use InputFieldSelect - newbie question
adrian replied to swissdoode's topic in General Support
It really does depends on your needs. @teppo has a valid point about using the Options field, but I have actually used pages for storing years because of all the other possibilities of using a page field provides (too many to go into here). Not saying I wouldn't use the Options field for years in a different project, but just saying you should read up and plan ahead before deciding. Remember that pages are just database rows, so 100 rows is not a big deal. Also, if you are worried about creating those pages, check out: or -
You might be looking for getForPage(), but you might be better off with subselectors: https://processwire.com/api/selectors/#sub-selectors There are some examples in there about finding main pages based on the content of repeater fields on those pages.
- 1 reply
-
- 4
-
You can definitely use include() inside a Hanna Code snippet. Have you tried an absolute path to that portfolio.php file?
-
Thanks @Robin S - really appreciate you testing all those options. It sounds like you are suggesting the last option is likely the best, which sounds good to me. Before I commit that change, could you please check that editor paths work everywhere in Tracy on Windows. Key places to check are: errors panel "bluescreen" fatal errors links to file/line from dumps panel entries log panels (does clicking on the message take you to that line in the log file) template resources - page number links from variables, functions, other files etc ToDo panel PW Info panel - edit the template file icon The reason to check all these is that many of them are not built by the Tracy core editorMapping option. Thanks again! PS - I am not suggesting that change of yours would break them if these other links were working already - I just want to make sure that there aren't any other situations we need to cover for Windows.
-
Do you mean the "Parent to restrict Role Name and Custom PHP code matches to." setting? That setting is completely optional, but the key thing is that obviously it must be above all the branches to be restricted. If your branches to be restricted are direct children of Home, then there isn't much point in this setting. It really only comes into play if they are several levels down as it reduces the page selector to that tree. You can see how it works here: https://github.com/adrianbj/AdminRestrictBranch/blob/15c70b90144fa68cafed0cdbb2d802e5dcfa1f2c/AdminRestrictBranch.module#L236 - see how $branchesParentSelector is defined using the "has_parent" selector. Anyway, that setting isn't relevant to you and it sounds like you have everything working correctly?
-
I just tested that exact name for the name of the parent page and also the role name and it is working fine here, so it should work for you from what I can tell. Perhaps a multilanguage issue - is the name of the page in all languages set to nord.pw.local ?
-
Please let me know what you find out. Are you talking about the "Role Name" matching option? I think some people haven't understood this option properly. It's what I use all the time for my sites, but to be clear, in your case you'd want the name of the role to be "page-nord" to match the name of the page that is the parent of the branch you are restricting them to. Does that help, or is that what you are already doing? Or maybe you found a bug?
-
Nice, although I assume that second screenshot is with superuser logged in since it shows all branches? PS - don't forget what I mentioned earlier on about just applying access permissions to the home template and no others - if you are using this module it simplifies things a lot.
-
Sounds like something isn't quite right - if I click the page tree icon, they still get the same restricted branch. Are you talking about the icon to the left of "Pages"? When I click that, I still get the restricted branch in the panel, like so: Is this what you are talking about, or something else?
-
@Guy Verville - I would really like to know if Admin Restrict Branch works in multisite mode. I expect it should work just fine. I use it in what sounds like a very similar situation to yours - I have the same set of pages and templates for regional/project specific branches of the page tree. With that module I simply give everyone access to everything on the home template and let inheritance provide access to all templates below and the module takes care of keeping users completely restricted to their regional branch - they can't even see the other branches (or any other pages outside their specific branch). If you find any problems in multisite mode please let me know and I'll see what I can do about supporting it.
-
No problem @Robin S - the catch with your: $compilerCachePath = str_replace('/', '\\', $compilerCachePath); fix is that it breaks the paths for us Mac/Linux folks. I feel like this shouldn't be that hard to sort out, but not being able to test doesn't help.I wonder if: $compilerCachePath = realpath($compilerCachePath); or something along those lines might work?
-
How can I specify default value for certain input field?
adrian replied to PawelGIX's topic in General Support
Hi @ethfun - welcome to PW! We do have default values now for certain fields. I don't recall all of them, but definitely for Integer, which should work if you are looking for a span value like in Joss' post. Of course if you need another fieldtype, you can always just do this in your template code: $value = $page->fieldname ?: 4 -
I haven't tried, but maybe changing the Open and Close tag settings in the Hanna code config might help you get around it: Admin > Modules > Hanna Code Text Formatter
-
@bee8bit - not sure if this works for ajax and repeaters, but take a look at this PR: https://github.com/ryancramerdesign/FieldtypeMapMarker/pull/11/commits/b38b5adc95e8a973ac7676348bc6b214a0b66f92
-
Nice @Robin S - I really ilke the Hanna Code approach - ultimate flexibility and so simple to implement!
-
How to get PageTable pages when not published
adrian replied to alexcapes's topic in API & Templates
I don't really understand why: $page->editions->find("include=all")->first()->title; doesn't work. I just tested: $page->editions->find("sort=-sort")->first()->title; which does work, so I think PageTables are missing the "include" option in the find selector. Seems like a bug to me - anyone else?- 9 replies
-
- pagetable
- unpublished
-
(and 1 more)
Tagged with:
-
That's a very funny and depressing read
-
Ah sorry - have a good read through this: https://processwire.com/api/fieldtypes/images/ But in essence, if it's not set to 1 then it returns an array of images, so you can either set to 1, or use this to get the first image. You can also use last() or eq(n) to specify a specific image. $panel->image_single->first()->size(400,200)->url
-
Is image_single set to a max of 1 image on the details tab?
-
I got forced into using CS on an app project last year - in some ways I kinda liked it, but didn't see any huge advantages or time savings. I also didn't really like that it wasn't a standard - I'd rather go with more official options like ES6/7 or whatever we end up with. I am sure you know, but BabelJS let's you use these syntaxes now.
-
I don't think @Zeka was saying you have to use hooks - I think he was showing you the code that soma used for saving a language specific value to a field. Using: "name$lname" where $lname is actually defined as the ID of the language. Take another look at soma's code and I think you will find what you need.
-
Adding Google Analytics and Ad Roll? New to PW
adrian replied to johppann's topic in General Support
I think you're right!- 9 replies
-
- 1
-
- google analytics
- ad roll
-
(and 2 more)
Tagged with: