-
Posts
5,948 -
Joined
-
Last visited
-
Days Won
284
Everything posted by bernhard
-
have you added google maps to your frontend <head>? <script type='text/javascript' src='https://maps.googleapis.com/maps/api/js?sensor=false'></script> if yes: maybe you can show us some code?
-
Thank you! 1) thanks, did read it and together with the blog post it was very helpful: https://processwire.com/blog/posts/new-module-configuration-options/ 2) thank you! 3) damn... i looked at this file but didn't see the info in the comments
-
thank you mike! where would i find this info on my own? i looked into several modules on github but didn't find it anywhere... i knew i've read it somewhere but couldn't remember... are there any docs? or in which file would i have had to look into to find all available options? or could i've done a var_dump() or something?
-
thank you mike! does anyone know how i can define the minimum processwire version? is it possible? i used the new config method from pw 2.5.5 https://processwire.com/blog/posts/new-module-configuration-options/ so i guess it's only compatible for PW2.5.5+ and i would like to add this information somewhere...
-
hi fliwatuet, sure you can, but you will have to do some research first to get the idea of how access control works in PW http://lmgtfy.com/?q=site%3Aprocesswire.com+users+and+access
-
update version 2 i was not sure where to put the images folder to be honest. changed it to /site/templates/TemplatePreviewImages - added 2 fields to configure width + height resizeing is done via jquery because i did not know how i would change the CSS dynamically based on module configuration. i tried to create a style.php instead of custom.css but that one was blocked (i guess by the pw htaccess?). thank you for your suggestions lostkobrakai
-
hi everyone, i'm happy to share my first little module that could have broader use... use at your own risk! i'm quite new to module development Usage Just install the module and place your preview images in the folder /site/templates/TemplatePreviewImages filename = template-name.png Github https://github.com/BernhardBaumrock/TemplatePreviewImages Notes jquery image picker used in this module (MIT license): http://rvera.github.io/image-picker/ Room for improvement / roadmap: Images are resized via CSS (height: 200px) Images could be placed via masonry or the like create image-field to upload preview images directly to the template looking forward to hearing your feedback ps: is it intentional that i am only allowed to choose from 2 templates when adding the page and have more options available when editing the template settings of the page like you can see in the video? i'm wondering why this should be like this?!
- 14 replies
-
- 24
-
-
hi ngrmm, you can also make it dynamic to not rely on the id 1019 like this: $page->parent->children->first() // instead of $pages->get(1019)->children->first()
-
Using PW variables in descriptions and notes
bernhard replied to adrian's topic in Wishlist & Roadmap
for reference: TagReplacer can do it https://processwire.com/talk/topic/11208-inputfieldtagreplacer/ -
Module Module: RuntimeMarkup Fieldtype & Inputfield
bernhard replied to kongondo's topic in Modules/Plugins
is it possible to use the value of this field for field dependency selectors? that would be really great but i didn't get it to work... i created a field "testruntime" i set visibility for field "headline2" but the field does not show up... any help for this? thanks for the great module - it was on my wishlist https://processwire.com/talk/topic/10555-using-pw-variables-in-descriptions-and-notes/ edit: i was on the wrong track with this one... field dependencies work on the client side with JS and won't take care of the field value when the field is hidden -
changing this $new_it = $_GET['it']; // we store it to later append it back to that $new_it = $this->it; // we store it to later append it back solved the problem. the undefined index warning only appears on "root" pages when no further urlsegments are defined. $this->it is set on line 45: $this->it = (isset($_GET['it'])) ? ltrim($_GET['it'], '/') : ''; @soma: any news on a new version? i think you mentioned it somewhere?!
-
What it does: you can easily define replacement-tags in your fields (also descriptions) like this: [demo] => '<span class="demo">some demo markup</span>', [demo2] => '<span class="demo">some other demo markup</span>', [demo3] => '<span class="demo">one more demo markup with a <a href="#" class="pw-modal">modal link</a>!</span>', Screenshot: Why? today i had to (to be more precise: i wanted to) have a link in one of my field-descriptions that opened a modal to a list of icons... basically i just wanted to add a "pw-modal" class to the link what is not possible through markdown [link](http://example.com) i ended up with the following little module: // removed - please see the code on github its also on github: https://github.com/BernhardBaumrock/ProcessWireModules/blob/master/InputfieldTagReplacer.module i know but didn't use RuntimeMarkup because i wanted the link in the description not in a separate field! Questions: would it be possible to get the currently edited $page somehow? the $page object i get now is the admin page with the according process. it would be nice to be able to do things like $page->parent or the like... would there be another method to hook into that would be more efficient or better in any other way? how can i debug the $event object? i tried var_dump($event); die(); but that showed nothing var_dump($event->return); die(); shows the form/field markup would there have been an easier way to achieve this?
-
Another option would be to create a textformatter module (it's really simple) and have it replace your tags with the field values. Would be quite the same as Hanna code... Hanna code would maybe be more the click click way of it
-
nobody said it can't be used for the whole template hmm... nice. you could also handle everything in your template and outsource your markup to a different file: yourtemplatefile.php <?php $config->session->myvar = 'test1'; // set session variable manually for testing $cache = $modules->get("MarkupCache"); $cache_key = 'page_'.$page->id.'_myvar_'.$config->session->myvar; if (!$output = $cache->get($cache_key)){ $output = wireRenderFile('_markup.php'); $cache->save($output); } echo $output; _markup.php <html> [...] <?= $page->title ?><br> <br> <?= $config->session->myvar ?> [...] </html> so all your templates that are using "yourtemplatefile.php" will have cached output based on your session key. don't know how this compares to templatecache regarding performance but would be interesting to know
- 6 replies
-
- 1
-
-
- cache
- built-in template cache
-
(and 3 more)
Tagged with:
-
hi mav_medved, welcome to the forum! sounds like markupcache is the right thing for you: https://processwire.com/talk/topic/7-new-markupcache-module/ http://modules.processwire.com/modules/markup-cache/ you could just create a cache-file bound to your session variable $cache = $modules->get("MarkupCache"); if(!$data = $cache->get($your_session_var)) { $data = [...] // your code $cache->save($data); } echo $data; don't know if or what procache has to offer in this case... hope that helps
- 6 replies
-
- 1
-
-
- cache
- built-in template cache
-
(and 3 more)
Tagged with:
-
thanks for this module martijn!
-
my hint about google search was more a general one i agree with you that it should be kept up to date but i also know how well it is documented coming from joomla/seblod (that was a pain ). and of course you will always find a helping hand in the forum. maybe not the answer you wanted to hear but i think your point is known one and i think i've already read about plans to overhaul the docs/site structure of processwire. don't think it has priority though and i don't think it should have as the level we have is really good even if it's not perfect...
-
getting a Phishing Website warning on one of my sites?!
bernhard replied to bernhard's topic in General Support
thank you all for your suggestions! i know there are lots of iframes coming from facebook & addthis... as the budget was really low i wanted to keep things really as simple as possible (for me). i have those scripts on other websites without any problems though -
today i got the following warning when visiting one of my processwire sites: i'm talking about the following site: http://www.scweissenkirchen.at any ideas why this warning could have appeared? i don't find anything suspicious in the code... does anyone else use 360 security (http://www.chip.de/downloads/360-Total-Security_69511987.html) and get this warning? thanks for your help!
-
hi nixsofar and welcome to the forum you are right, $pages->add is not listed in the api docs: https://processwire.com/api/variables/pages/ for now i think it is always the best to look directly into the code if you want to be 100% sure not to miss anything. it's all well commented and both the docs and the cheatsheet are not always complete imho... back to your question: https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/core/Pages.php#L600 and of course searching processwire via google can often be helpful: https://processwire.com/talk/topic/6196-easy-search-on-pw-forums-with-google/?p=60632 happy coding
-
Servus James and welcome to pw! 1) I think what you are talking about is called delayed output. There is a tutorial here: https://processwire.com/docs/tutorials/how-to-structure-your-template-files/page4 And a helpful thread here: https://processwire.com/talk/topic/740-a-different-way-of-using-templates-delegate-approach/ 2-4) sorry on mobile but don't really get your questions. Did you already do the hello world tutorial from the docs? Also have a look at the site profiles and as how Ryan does it Have fun with processwire und liebe grüße aus Wien PS: I think one thread per question is easier to understand and answer
-
New Installation: Field to upload site-profile
bernhard replied to bernhard's topic in Wishlist & Roadmap
hm... you are right. having an empty writeable site-upload folder could work?! there would have to be only ONE folder because you could also only upload ONE site-profile at a time. the installer would only have to take the uploaded zip, copy its content into /site-upload and update the select-field with the description + thumbnail from the uploaded file. don't know how hard that would be in the installer.php and if one can easily add a standard pw file upload field at this place? -
hi tuningspoon, sorry can't test it because i was only working on this intranet project for the last week and had more important issues to deal with. it's ok to create pages under globals, link them and afterwards move them to their right location. the pagefield will keep the right reference. thanks anyhow for your help i just wanted to mention this usecase maybe to keep it in mind for further updates. but i also think that this is a quite special one.
-
New Installation: Field to upload site-profile
bernhard replied to bernhard's topic in Wishlist & Roadmap
hm. sounds like a valid point. but couldn't a chmod solve that in the next step easily? thanks for your two cents, horst -
Only on mobile... Love it! Great design and well organised. Welcome and happy processwiring