-
Posts
6,798 -
Joined
-
Last visited
-
Days Won
158
Everything posted by Soma
-
It's just a 404 message. I'm with that the editor doesn't need to edit that text. That's why it's set in the core (page id) to be only listed in the page tree for superusers. The 404 is just a regular page that is defined in the config via page id. You can overwrite that with $config->http404PageID = 1024; But this will just that page also. SOmething like kongondo would be a solution to still make it. You could add a settings page or even better a custom 404 page with the same template as the 404 page and have it in the tree set hidden. To replace the rendered page of the 404 page with your own created page, you can add a hook with a autoload module. Look at HelloWorld.module which is such a module that autoloads on each request. ... public function init() { $this->addHookAfter("ProcessPageView::pageNotFound", $this, "hook404Page"); } public function hook404Page($event){ header("HTTP/1.1 404 Page Not Found"); $page = wire("pages")->get("/404/"); // get your 404 page $this->wire('page', $page); $event->return = $page->render(); // render and return that page }
-
yeah definately something like this.
-
If you look at FieldtypePage getInputfield() it's only InputfieldPage. Then in InputfieldPage you see protected static $defaultInputfieldClasses = array( // default options 'InputfieldSelect', 'InputfieldSelectMultiple', 'InputfieldCheckboxes', 'InputfieldRadios', 'InputfieldAsmSelect', 'InputfieldPageListSelect', 'InputfieldPageAutocomplete', ); InputfieldCheckboxes is only for InputfieldPage alternative input. InputfieldCheckbox is only the input for FieldtypeCheckbox. It's a single checkbox input while InputfieldPage can be multiple. It looks like you are mixing a lot of things up, and looking at your module, your "role_permitted_templates". You have a text field with comma separated values but want to use InputfieldPageName for sanitizing like a page name but which will remove ",". This wouldn't work anyway apart from that you can't use InputfieldPageName here. Just stick with a InputfieldText or InputfieldTextarea, to enter templates comma separated or per line. It would be cool to have a ASM select to select templates, but this would only work if you only use the InputfieldPage with a ASM select, and add templates as options with templateid=>templatename. This unfortunately isn't possible when using a real custom field added to a template, it's only for use when adding it through a hook to a fieldset and on saving take the selected option(s) to save it somewhere.
-
Ah ok I looked a little closer and of course PW doesn't allow special chars in urls. So if you want to use url segments, you can with a little workaround. I updated my code to allow for url segments or GET. Set the variable at the top. Also made some changes to not have lower case the tag. But if you use url segments the $alltags array is used with key=>value to get around it. So it would store "fruehling" => "Frühling", and then take that to get the original value in the image tags find. The sanitizer method $sanitizer->pageName(string, Sanitizer::translate); Sanitizer::translate can be used to convert special chars as you configured in InputfieldPageName module settings. There you can specify that 'ü' will convert to 'ue'. This way you'll get url segments like "fruehling" instead of "frhling" or "fruhling". After all the using of GET urls parameter may be the easiest as you don't have to take care if using cyrillic chars.
-
Have you even tried it?
-
The sanitizer selectorValue does that I think. Try using another sanitizer like text. But have to look at the laptop. Maybe its the urlsegments.
-
Put the method in the hook in "".
-
In peocesswire we have the collapsed option.
-
I eat them.
-
Give three programmers individually the task for a specific application and you'll get three complete different solutions. Ask them to look through each others code and all will correct each others.
-
That's a dangerous question. Nothing wrong but it's a though combination I don't really like. Especially the background is very standard green and almost impossible to use in this combination. I looked on a movile. And the big font is playful but horrible It's a little barebone yet and and hard to get a feeling of the direction.Sorry for being harsh. The great is often close.
-
Index template aspecific of 'sub' template? // Hello!
Soma replied to jtborger's topic in Getting Started
Welcome! Just quick. Theres plenty of template settings to use. If you want to share template files you can define alternative template filename under advance d tab. So you can have multiple share same file. -
Superuser will always bypass see three posts above pete explains. The guest role is for public visitors.
-
Ah no not at all. All you do with api on front end to add or save content is non access aware and it does what you tell it to do. You could take roles and permissions into account and most likely this is what you do. PW has those checks also implemented same as you would do on your front end. The edit page screen wont load and throw an error if you dont have permission but you're not using the admin processes in your frontend so you take care through api on your own.
-
Well this code is from the PW core. It has some API methods to search for tags like for Pagefiles $images->findTag("tuggy") or $image->hasTag("taggy") etc...
-
The code I posted would be in a autoload module. Instead of the init() it is the ready() because it's executed when the full API and page request is ready. If you have HelloWorld.module put that function inside just after the init(). When you have the module installed it's active and all users with "editor" role will get redirected to "/" if they try to access admin.
-
Again, as I said in my previous post, if you give the user only view permission, they won't get into the backend. When they login through admin login you'll get a "continue" link that links back to the website. So without doing anything you already got those user from accessing the backend, but they still can use the admin login screen if they know it, but it's not issue at all. In one of a project I used this technic with a front end sign in and login http://muetterhilfe.ch/angebot/online-beratung/anmeldung/ Similar to what you say, I create a user page after they successfully registered, and save that in a page field on the user. After they login they get redirected to their page with a simple profil page and form to ask questions a expert then can answer. All the "permission" and handling is done without any permissions or special roles (just the user role with base view permission) just in the templates with absolutely basic API code. User's can't access other user pages, and this is simply done in the user page template, it checks if this really is the current user page. It all requires minimal coding and setup. It's so simple it's scary and often you think this can't be, but it is. When I find the time I'll maybe make a write up or simple profile that shows this simple setup.
-
Only {$page->next->url} won't do anything you need php to echo out the variable. <?php ... ?> to let it know there's php code coming <?php // open php tag echo "<a href='{$page->next->url}'>$page->title</a>"; // end php tag ?> PHP will parse the {vars} if used inside double quoted "string" strings. Or <a href="<?php echo $page->next->url;?>"><?php echo $page->title;?></a> Or if server supports it there's a short notation <?= $page->next->url ?>
-
[solved] moved Local-PW online: Error=Call to a member function hasRole()
Soma replied to horst's topic in General Support
Are there modules that manually installed and via modules manager short mm.. ? -
Roelof theres example I did for what you're looking for in that thread over therehttp://processwire.com/talk/topic/3868-pagearray-vs-explode/#entry37919
-
Without knowing what script you use (custom built or downloaded) you could also add the image directly to the html and hide it. Then use it in you js and make it visible when you need it. Or you can add a data-url to a DIV tag and read that from the javascript. <div id="topimage" data-url="<?php echo $config->urls->templates . "img/top.png"></div> And in your javascript with using jquery var img = $("#topimage").data("url");
-
I mean dev of the theme version just to make sure ;-)
-
I develop it so I never have to change it. I never develop in a different structure than on dev and live... But if you do so and change root directory or have in a subfolder and on live not, you'll have to take care of image paths and link in PW anyway So one way is to pass the root path you can do so by passing it to js via a script in the header template. <script> var config_root = "<?php echo $config->urls->root ?>; </script> then in your .js files you can use var img = config_root + "site/templates/img/whatever.jpg";
-
Yeah but still don't know where you're js lies and so can't say, but it's easy to make a relative path from your js to the image...
-
It's in the dev version, you hover to show the actions...