-
Posts
321 -
Joined
-
Last visited
-
Days Won
5
Everything posted by justb3a
-
@titanium: First of all thanks for testing and feedback I cannot reproduce this behavior. Could you please provide me more informations: ProcessWire Version Number of max allowed files Overwrite existing files? Do you just change meta informations or upload a new image? Do you use ImageExtra in combination with any other Image Module? (Please tell me which one) I installed a fresh ProcessWire installation, Beginner Package (just one language), and it works without any problems. EDIT: I still cannot reproduce this behavior but I changed this line to: $value = $this->wire('sanitizer')->entities($language ? $pagefile->{$current}($language) : $pagefile->{$current}); I hope it works now.
-
oh, I didn't notice that topic, I would have responded as well. Maybe it's a good idea to add an external url field. What do you think?
-
Module: Fieldtype Image Extra (multi-language)
justb3a replied to justb3a's topic in Modules/Plugins
I developed a new module ImageExtra which allows you to combine custom fields and image cropping (for example). Please have a look at this forum post. This module will not be developed any further. Be careful: if you decide to use ImageExtra with an existing site you'll have to start from scratch. So please make sure to backup your data - just in case you need to go back -, because the old settings are not compatible with the new module's format. -
Some time ago I developed a module (FieldtypeImageExtra) which extends Fieldtype Image with the ability to add custom fields to an image. This worked well but it had a somehow restricted applicability and did not meet all of our needs. There of course are other useful image modules like CroppableImage or ImageFocusArea, but up to now there was no possibility to combine image cropping with custom fields support. So you had to decide whether to add image cropping or the possibility to add custom fields because each of those modules sets up their own field type (and input type) which cannot be combined. The new module ImageExtra allows you to have both functionalities. You can get the module from GitHub. For more informations have a look at this blog post. If you notice any problems or unexpected behaviour please let me know.
-
Thanks a lot for this quick fix I checked out the dev branch, reset my deployment script and everything works fine (and all post authors are happy now ).
-
I got another little issue. If someone uses the quickpost function and fills out quickpost_body all line breaks will be removed. I don't think that is it necessary to use a rich text area here but maybe you can wrap it in a simple nl2br function? //@todo - SHOULD THIS BE A RICH TEXT AREA? - $p->blog_body = $this->sanitizer->textarea($this->input->post->quickpost_body); + $p->blog_body = nl2br($this->sanitizer->textarea($this->input->post->quickpost_body
-
MarkupSEO - The all-in-one SEO solution for ProcessWire.
justb3a replied to Nico Knoll's topic in Modules/Plugins
Thanks for this module. I use smart fields and got a little bit trouble using the description field. Because I chose fields which include html tags. Even if if I check "Strip Tags" in the field settings for seo_description. I guess that this setting doesn't take effect if the field was left blank. This results in: <meta name="og:description" content="<h2>KF Interactive GmbH</h2> <p> D-04107 Leipzig</p> <p>Tel.: +<br /> Fax: +<br /> Mail: <a href=" mailto:info@kf-interactive.com"=""> <p><strong>Konzeption und Gestaltung der Website:</strong><br> <a href=""></a> & KF Interactive</p> "> .. and breaks the layout. I changed line 206: - $pageData['description'] = $page->get(implode('|', $configData['descriptionSmart'])); + $pageData['description'] = strip_tags($page->get(implode('|', $configData['descriptionSmart']))); .. and everything works Maybe you could include this litte fix in a later version? -
Adrian no problem Indeed I appreciate this, it's always good to learn more and to get some feedback. I just started my second ProcessWire project and there is so much more to discover... I tried to use the Page Fieldtype (parent=page.otherpagefield) but I got a complete different output. The point is that I don't want to get a whole page object, I need a plain value in order to receive this value using the ServicePages API. Unfortunately my use case is quite complex and you need a lot of background knowledge so I had to find another example. Use case: Categorize Posts/Pages "The common way": Create a single page for each category. Add a Page Inputfield, set up the parent page / template and you get a select list of categories (pages). Fine. "My way": Create just one page to hold all categories in a repeater. Add a SelectRelation Inputfield, set up field=category, repeater=r_categories. Then you get "the same" list. If you need more than just the title (or any other field) you should use the Page Inputfield for sure. The difference is that you don't select a page, you select a field value depending on a page. I guess this should also work for Profield Table subfields but I didn't test it.
-
Sounds good! In my installation I deactivated comments, that's why I havn't though about the option 'most commented on related posts' (but I really like the sort option). I have not that much blog posts so I need the following combination: find related posts by 'both tag AND category', by 'category' and by 'tag' (in that order) to fill my list.
-
Great Module! Thanks! I miss one litte functionality - display related posts (or did I miss something?). Maybe someone else needs this, so here is the code (I use this in a TemplateDataProvider): public function populate() { $limit = 3; $selector = array( 'template' => 'template=blog-post', 'id' => 'id!=' . $this->post->id, 'categories' => 'blog_categories=' . $this->post->blog_categories, 'tags' => 'blog_tags=' . $this->post->blog_tags ); // find posts same tag AND category $related = wire('pages')->find(implode(', ', $selector)); if ($related->getTotal() < $limit) { // find posts same category $related = $this->getRelated($related, $selector, 'tags'); if ($related->getTotal() < $limit) { // find posts same tag $related = $this->getRelated($related, $selector, 'categories'); } } $this->related = $related; } private function getRelated($related, $selector, $remove) { $selector['id'] .= '|' . (string)$related; unset($selector[$remove]); $rel = wire('pages')->find(implode(', ', $selector)); return $related->import($rel); }
-
The module uses now the WireMail function instead of php mail. Besides I added the tag "scf" for fields and templates created by this module (just available on a new installation).
-
@Pete: perfect for the moment thanks a lot!!
-
I added two config options: Including not only visible pages: optional, include all hidden and unpublished pages and pages that user doesn't have access to view Multiple Output: optional, multiple selection (using ASMSelect) Field settings: Select Lists: (settings above -> first one)
-
I needed another structure as well. Therefore I built another litte module which rewrites the structure due to my needs. This module contains a function in which the content is loaded using ServicePages module (in my case via curl). Rewrite and output the result. Or maybe you could use TemplateDataProvider Module to handle this (I needed a lot more so I decided to build my own module).
-
Thanks! It would be great to have a link of the developer page to the forums member page and if the developer created some modules the reference as well. (And I miss my module author icon )
-
I'm not quite sure if this is worth to be a module. But I needed it... This Fieldtype creates a select list (drop down) in relation to another field (you can restrict the list by setting up certain templates and / or pages). Installation: 1. Clone the module and place FieldtypeSelectRelation in your site/modules/ directory. git clone https://github.com/justonestep/processwire-fieldtypeselectrelation.git your/path/site/modules/FieldtypeSelectRelation (or get it from the module page) 2. Login to ProcessWire admin and click Modules. 3. Click "Check for new modules". 4. Click "install" next to the new FieldtypeSelectRelation module. Usage: After installation, you'll have a new "Select" fieldtype that will allow you to define the items you'd like in the drop down depending on another field. Create a new field and assign type SelectRelation Click on the Details tab, there you find different fields to create your select list Field: required, choose another field you created before from which the select list should be populated Repeater: optional, if the field you chose is included in a repeater, select the repeater here Template(s): optional, restrict your result by setting certain template(s) Page(s): optional, restrict your result by setting certain page(s) Unique Values: optional, check this field if you want to avoid duplicate values (If you enable this, the string value will be saved instead of the ID. You will not be able to reference via ID.) Including not only visible pages: optional, include all hidden and unpublished pages and pages that user doesn't have access to view Multiple Output: optional, multiple selection (using ASMSelect) Unique Values Disabled If this field is not enabled the key is the pages_id and the value is the value from the other field. <select id="Inputfield_chosen_fruit" name="chosen_fruit"> <option value=""></option> <option selected="selected" value="1026">Strawberry</option> <option value="1030">Apple</option> <option value="1031">Banana</option> <option value="1032">Lemon</option> </select> Note: If you change the value of a field the value changes too. If you deleted a value the value now is empty and multilingualism works like a charm. Accessing the value: // single select echo $pages->get((int)$page->chosen_color)->color; // multiple select foreach ($page->chosen_color as $p) { echo $pages->get((int)$p)->color; } `chosen_fruit` and `chosen_color` are of the type SelectRelation. `title` is the page title and `color` a simple input field (TextLanguage for example). In `chosen_fruit` the selected field is `title`. And in `chosen_color` the selected field is `color`. Unique Values Enabled If this field is checked the key as well as the value are the value from the other field. <select id="Inputfield_chosen_color" name="chosen_color"> <option value=""></option> <option value="red">red</option> <option value="green">green</option> <option selected="selected" value="yellow">yellow</option> </select> If you don't check this box you might have duplicate colors (because there is more than one fruit which has a yellow color for example). BUT if you change the value of an field, your already chosen value stays the same, because there isn't a relation via ID. Access such a field like you are used to: // single select echo reset($page->chosen_color); // multiple select foreach ($page->chosen_color as $p) { echo $p; } TL;DR: I tried to save a comma separated list for duplicate values .It works until you change anything. For example, if you have two times the color yellow a key of the kind '1034,1036' may get saved. Now assume you change a basic color (the banana turns brown ), the selected value is now empty because a key like '1034,1036' doesn't exist anymore. And in the frontend you may get a wrong output.
- 16 replies
-
- 14
-
I need to output the content of a repeater field. Logged in as a super user everything works as expected: .. "matches":[{"id":1,"parent_id":1,"template":"repeater_example","path":"..","name":"..","content":"lorem ipsum dolor sit"," .. But when I'm not logged in, I get nothing. .. "matches":[]} Every other "normal" template works as expected, I guess the problem is the repeater template which has not the access to be viewed by guest users. The selector include=all is automatically added for superusers (wire ▸ modules ▸ Process ▸ ProcessPageSearch Line 271). include=hidden is not enough. Is there a way to enable repeater templates to be viewed by guest users? For now I use single pages instead of the repeater. But I need just one value per page. Any help would be appreciated
-
The automatic limit comes from the ProcessPageSearch module. wire ▸ modules ▸ Process ▸ ProcessPageSearch Line 55 protected $resultLimit = 25; ServicePages calls $process->executeFor(); and in that function the limit is set. $limit = $this->resultLimit; Setting the limit via URL (see code below [Line 200]) works fine for me but the input field has no effect at all. if($name == 'limit') { $limit = (int) $value; $this->input->whitelist('limit', $value); continue; } Btw: I get the limit parameter two times: {"selector":"template=cranach-house, limit=25","total":2,"limit":25,"start":0,"matches":[{" ... EDIT: ok, I guess there is a mixing up. In the module settings you enter the maxLimit value the url parameter is allowed to be. Example. Maximum pages to match per request is set to 20. http://.../service-pages/?...&limit=12 => WORKS http://.../service-pages/?...&limit=22 => DOES NOT WORK {"errors":["Out of bounds limit setting (max=20)"]} maxLimit != limit The limit parameter can only be overwritten by URL parameter.
-
Module: Fieldtype Image Extra (multi-language)
justb3a replied to justb3a's topic in Modules/Plugins
@reems Did interrobangs solution solve your problem? @Joss Try to reassign the Fieldtype ImageExtra. I assumed that you first enter your module config and then add the Fieldtype. The other sequence does not work atm (I have this as a bug on my whiteboard ). The new database columns will be inserted only by FieldType switching. -
That sounds great, I will use and test it in my next Processwire project for sure! Looking forward for the PvcRendererTwig
-
RT @Ingeborch: Habe den Mann mit Liste einkaufen geschickt und die Punkte vergessen. http://t.co/IfCAXCE5WC
-
Is there a possibility to use the same bookmarks in Chrome and Chrome Canary? Symlink does not work.. #googlechrome #chromecanary
-
@makari: This module creates a simple template, you can / should change the html structure as well as the label texts. If you need multi language support you have to change the text like this echo __("the label text here!"). Now you can translate the labels via Processwire Backend. @horst: Thats a good point but first I have to finish another project. I will keep it in mind – as some other things (I did not forget your message ).