Jump to content

Juergen

Members
  • Posts

    1,229
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by Juergen

  1. Thank you diogo for your answere. The visibility on field dependencies is quite a possibility but.... 1) in this case the value is still stored in the DB and will be also fetched via the search engine (I mean my site search not Google ). Thats one reason why I want to get rid of it. 2) I use Pagetable for all the prices in my pricelist - so every price item is one single page. And in the pagetable I have the column for the offer price. So it contains always the value of the offer price if it is filled out (independent if the price is standard price or not) - this could be confusing for customers.
  2. hello @ all, I want to find out if this is possible in PW. I have 3 fields in a template: field 1: Option fieldtype with 2 options to select (single choice). -option 1 (standard price) -option 2 (offer price) field 2: Input fieldtype decimal for the standard price value (fe 10€) - equals option 1 field 3: Input fieldtype decimal for the offer price value (fe 5€) - equals option 2 So here is the process: 1) Select if the price should be a standard price or a offer price 2) If field 2 and 3 have values in it - then delete the value of the option which is not choosen after pushing the save button. Example: I choose standard price (option 1) Field 2 (standardprice) will be filled with the value 10 € by me Field 3 (offerprice) contains the value 5 € from an earlier time as this was an offer. After saving the article the value of 5€ from field 3 should be deleted because I have choosen option 1 (standard price). Therefore the offerprice is no longer needed and should be deleted. I hope it is clear what I mean. SO IS IT POSSIBLE TO DELETE THE VALUE OF ONE FIELD DEPENDING ON THE VALUE OF ANOTHER FIELD AFTER PRESSING THE SAVE BUTTON? Best regards Jürgen
  3. @netcarver, first of all thanx for the awesome module. Are there any news about a blank value as Beluga pointed out? I also need a blank value for opening hours. Best regards
  4. On my computer the problem is still there. I have tested it also with different browsers (Firefox, IE, Safari - always the latest version) - very strange behaviour. If some other users read this maybe they could test it on their computers and post their results here.
  5. In my case the redirect of the link doesnt work so the target is "http://new.korona-licht.de/produkte/systemprodukte/", which is the blank page. If it would be redirected to "http://new.korona-licht.de/produkte/#!systemprodukte" I could see the content - but this doesnt happen.
  6. Is it really working for you? If I click a linked image or the link above on the homepage, I always get a blank page. These are the links I am talking about (Systemprodukte, Projektleuchten, Innenbeleuchtung, Aussenbeleuchtung). As you can see - a blank page
  7. Beautiful site! But this URL leads to a blank page (http://new.korona-licht.de/produkte/systemprodukte/) - so check this out.
  8. Table Tools plugin is another possibility, but you have to purchase it. Another point to mention is that it could be confusing for customers. My experience is that the more possibilities you offer the more problems customers will have. I always tend to make it as simple as possible (ASAP). Dont offer to much settings or possibilities - every additional setting is often a challenge for them. But for better experienced users it will be a very useful plugin to create really complex tables in a quick way. So you have to decide depending on the pros and cons.
  9. No I dont need it at the moment and there are workarounds to achieve this. But they are not customer friendly. So it was only a thought to implement this to make multilingual file upload easy to manage for customers.
  10. It would be great to adapt the file upload field to be able to upload files for different languages. For example to add a checkbox in the field settings for "multilingual" as it is done in the PDF creation module. If this checkbox is checked then a file upload field will be created for every language. So you can upload f.e. a manual in German, English, French and so on. At the moment a file upload field must be created manually for each language needed. So this could be a useful addition for multilingual sites.
  11. It works also with "pricelistselect=2". So if only one value is the dependency it works quite well, but if the condition is a little bit more complex like "1 OR 2" it doesnt work anymore. I dont think that the value/label format is the problem. If there would be a problem it would not work at all.
  12. Hello @ all, I have a fieldtype options inputfield with single choice in a template. Depending on the the selected value a textfield should be shown or not. This is the options fieldtype: And this is the textfield which should be shown if select option 1 or 2 is selected. Unfortunately it doesnt work. The textfield will be always shown independent of the selected value. F.e. if I choose only a simple dependency like "pricelistselect=1" it works. Has somenone a hint for me, whats going wrong?
  13. Updating to PW 2.6.0 stable solves the problem - the whitespace at the beginning is gone.
  14. At the moment: In the plugin.js of the image plugin for the CKEditor the alignment class for the image will be added in the following ways. 1) Image without link and without caption: alignment class will be added to the image tag - OK (outermost tag) 2) Image without link and with caption: alignment class will be added to the figure tag - OK(outermost tag) 3) Image with link and without caption: alignment class will be added to the img tag, but this is not the outermost tag - NOT OK 4) Image with link and with caption: alignment class will be added to the figure tag - OK (outermost tag) Point 3: The alignment class should always be added to the outermost tag (in this case the anchor tag), because it would make it much easier for markup manipulation via textformatter modules. At the moment it is a very hard struggle if you want to work with image markup manipulation to get the image alignment to work. So it would be great to change the plugin.js to add the alignment class always to the outermost tag of the image part.
  15. Both of you are right! Substitute the div elements with span makes the validator happy (but this is not the reason that the image doesnt float left to the text). The CSS for the thumbnails makes them not floating left to the text. Here is the main problem. The alignment will be added to the image tag at the first image. <a.....<img class="align-left">..... If the anchor has no CSS-styling the image will be floated left - OK. If the anchor has the class property "display:inline-block", which is necessary in this context, the image will not be floated. The best way would be to add the alignment class to the anchor tag too. So I have to figure out the best way, how to add the alignment class to the anchortag too (not only to the image).
  16. Hello netcarver, I am a little bit closer to the source of the cause, but it is a strange behaviour. It is not the regex syntax which doesnt work, because it works quite well (mine, yours and LostKobrakais) The problem of the first image is that is is wrapped in an anchor element only. If I add an additional div around the anchor like <div class="imageholder"><a$1 itemprop="image" data-lightbox="gallery" class="img-responsive thumbnail"><div class="scalecontainer"><span class="roll"></span><img$2></div></a></div> the strange markup will be gone. Unfortunately the alignment behaviour (left, right) will be gone after adding the new div (imageholder) because the "imageholder-div" has to be the alignment class, but it has not.
  17. Hello LostKobrakai and netcarver, your code works in regex tester but on the page I got the same result as in my regex. It seems that in a textformatter module the regex doesnt work as expected. Images without figure tag will not be rendered correctly. You can try it by adding this textformatter module to the body field of your installation. Add 2 images via the editor to the body field. One without caption (so no figure tag will be added by the editor) and on with caption. After you check the source code of the output you will see that the manipulation of the first image fails. Best regards
  18. Thanks for your response LostKobrakai, I will try this and write a Feedback after that. Best regards
  19. Hello, I made a copy of the Textformatter Autoschema module to add additional Markups. I have included a additional regex to fetch all images which are inside a link. They should be modified with a little bit of additional markup to make CSS3 effects possible. Here is the copy of the module code with the changes. <?php /** * @author FlipZoom Media Inc. - David Karich * @contact David Karich <david.karich@flipzoom.de> * @website www.flipzoom.de * @create 201401-10 * @style Tab size: 4 / Soft tabs: YES * ---------------------------------------------------------------------------------- * @licence * Copyright (c) 2013 FlipZoom Media Inc. - David Karich * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is furnished * to do so, subject to the following conditions: The above copyright notice and * this permission notice shall be included in all copies or substantial portions * of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ---------------------------------------------------------------------------------- */ class TextformatterBootstrapMarkups extends Textformatter { /** * ------------------------------------------------------------------------ * getModuleInfo is a module required by all modules to tell * ProcessWire about them * ------------------------------------------------------------------------ * @return array */ public static function getModuleInfo() { return array( // ------------------------------------------------------------------------ // The module'ss title, typically a little more descriptive than the // class name // ------------------------------------------------------------------------ 'title' => 'Bootstrap Markup changer with Schema.org', // ------------------------------------------------------------------------ // Version: major, minor, revision, i.e. 100 = 1.1.0 // ------------------------------------------------------------------------ 'version' => 100, // ------------------------------------------------------------------------ // Summary is brief description of what this module is // ------------------------------------------------------------------------ 'summary' => 'Converts standard tags into Bootstrap markup classes enriched with schema.org data.', // ------------------------------------------------------------------------ // singular=true: indicates that only one instance of the module is allowed. // This is usually what you want for modules that attach hooks. // ------------------------------------------------------------------------ 'singular' => true, // ------------------------------------------------------------------------ // autoload=true: indicates the module should be started with ProcessWire. // This is necessary for any modules that attach runtime hooks, otherwise those // hooks won't get attached unless some other code calls the module on it's own. // Note that autoload modules are almost always also 'singular' (seen above). // ------------------------------------------------------------------------ 'autoload' => false, ); } /** * ------------------------------------------------------------------------ * Searches for tags and adds the right attribute. * ------------------------------------------------------------------------ * @param string $string * @return string $string */ public function format(&$string) { // ------------------------------------------------------------------------ // H1 headlines // ------------------------------------------------------------------------ $string = preg_replace('/<h1(.*)>/Uis', '<h1$1 itemprop="headline">', $string); // ------------------------------------------------------------------------ // H2, H3, H4, H5, H6 headlines // ------------------------------------------------------------------------ $string = preg_replace('/<h([2|3|4|5|6]{1})(.*)>/Uis', '<h$1$2 itemprop="alternativeHeadline">', $string); // ------------------------------------------------------------------------ // Tables // ------------------------------------------------------------------------ //$string = preg_replace('/<table(.*)>/Uis', '<table class="table" $1 itemscope itemtype="http://schema.org/Table">', $string); $string = str_replace('<table', '<div class="table-responsive"><table itemscope itemtype="http://schema.org/Table"', $string); $string = str_replace('</table>', '</table></div>', $string); // ------------------------------------------------------------------------ // Unordered lists // ------------------------------------------------------------------------ //$string = preg_replace('/<ul(.*)>/Uis', '<ul itemscope itemtype="http://schema.org/ItemList">', $string); // ------------------------------------------------------------------------ // Ordered lists // ------------------------------------------------------------------------ //$string = preg_replace('/<ol(.*)>/Uis', '<ol class="itemscope itemtype="http://schema.org/ItemList">', $string); // ------------------------------------------------------------------------ // Paragraphs // ------------------------------------------------------------------------ $string = preg_replace('/<p(.*)>/Uis', '<p$1 itemprop="text">', $string); // ------------------------------------------------------------------------ // Links // ------------------------------------------------------------------------ //$string = preg_replace('/<a(.*)>/Uis', '<a$1 itemprop="url">', $string); // ------------------------------------------------------------------------ // Address // ------------------------------------------------------------------------ //$string = preg_replace('/<address(.*)>/Uis', '<address itemscope itemtype="http://schema.org/PostalAddress">', $string); // ------------------------------------------------------------------------ // Images // ------------------------------------------------------------------------ // THIS IS WHERE THE PROBLEM IS LOCATED //add additional markup to linked images $regeximg = '/<a(.*?)><img(.*?)(\/)?><\/a>/Ui';//grab all images inside links $imgsubstitute = '<a$1 itemprop="image" data-lightbox="gallery" class="img-responsive thumbnail"><div class="scalecontainer"><span class="roll"></span><img$2/></div></a>'; $string = preg_replace($regeximg, $imgsubstitute, $string); } } ?> Take a look at the code for images near the bottom. This is what I have added. Unfortunately this only works if the images are in a figure tag like this: <figure class="align_left"><a title="" data-original-title="" href="/site/assets/files/1807/bora_bora_3.jpg"><img alt="Rochen" src="/site/assets/files/1807/bora_bora_3.132x0-is.jpg" width="132"></a> <figcaption>Rochen</figcaption></figure> But it doesnt work if the figure tag is not there like: <a title="" data-original-title="" href="/site/assets/files/1807/bora_bora_3.jpg"><img alt="Rochen" class="align_left" src="/site/assets/files/1807/bora_bora_3.150x0-is.jpg" width="150"></a> I have tested the regex with a Regex-Tester and it works. Take a look here. But this is the result on my webpage: As you can see the first image has errors in the markup - this is the image which is not in a figure tag. The markup of the first image after the manipulation looks like this: <p> <a title="" data-original-title="" href="/site/assets/files/1807/bora_bora_3.jpg" itemprop="image" data-lightbox="gallery" class="img-responsive thumbnail"></a> </p> <div class="scalecontainer"> <a title="" data-original-title="" href="/site/assets/files/1807/bora_bora_3.jpg" itemprop="image" data-lightbox="gallery" class="img-responsive thumbnail"> <span class="roll"></span> <img alt="Rochen" class="align_left" src="/site/assets/files/1807/bora_bora_3.150x0-is.jpg" width="150"> </a> </div> instead of this <a title="" data-original-title="" href="/site/assets/files/1807/bora_bora_3.jpg" class="thumbnail"><div class="scalecontainer"><span class="roll"></span><img title="" data-original-title="" href="/site/assets/files/1807/bora_bora_3.jpg"></div></a> So it makes always a strange markup and I dont know why because everthing seems ok to me. Maybe someone has an idea
  20. Thanks !!! Point 5 seems very interesting to me. Another possibility would be to copy the pwimage plugin, rename it, adapt the markup and use this instead of the original image plugin. In this case the markup will be stored in the database exactly the way that it is visible in the editor - no textformatter or jQuery manipulation necessary. Mhh, I am struggle within. I will think over.
  21. Hello @ all, I want to manipulate the markup of images added via the editor. In this case I have 2 possibilities: 1) To create a textformatter module or 2) to manipulate the output via jQuery General question: Will be the markup from a textformatter module cached or will it be created on runtime like jQuery? I prefer cacheable content so if it will be cachable I would tend to create a module instead of jQuery manipulation. Thanks in advance for your help.
  22. My goal was not to copy only one field. The body field was only an example. It would be great to copy all multilingual fields in the template with only one click. Imagine you have more textareas or editor fields in a template. One click and you have copied all your fields at once.
×
×
  • Create New...