Jump to content

Juergen

Members
  • Posts

    1,423
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by Juergen

  1. 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
  2. Beautiful site! But this URL leads to a blank page (http://new.korona-licht.de/produkte/systemprodukte/) - so check this out.
  3. 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.
  4. 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.
  5. 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.
  6. Yep that works! Thanks LostKobrakai
  7. 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.
  8. 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?
  9. Updating to PW 2.6.0 stable solves the problem - the whitespace at the beginning is gone.
  10. 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.
      • 2
      • Like
  11. 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).
  12. 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.
  13. 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
  14. Good Job! I like the design.
  15. Thanks for your response LostKobrakai, I will try this and write a Feedback after that. Best regards
  16. 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
  17. 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.
  18. 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.
  19. 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.
  20. Copying the source code is necessary at the moment. Anyway. It could be a useful feature to copy content via clicking a button and maybe it could be integrated easily without a lot of effort. But this is not a real important feature. It was only a thought of mine to improve the workflow. Best regards
  21. It would be great to add a copy button for content fields on multilingual site. F.e.: You have written a complex text with images, tables and so on in your body field in your default language (fe English). After that you want to translate the content to other languages (German, French). Therefore you have copy all the content. If there will be a copy button to copy the whole content of the default language body field to all the other language body fields with only one click. You will only have to translate the content. There will be no need to insert all the elements once more by copy and paste. This would be a great addition to make working with multilingual sites much more comfortable. Best regards
  22. I would suggest to include a delete button for images in the modal window of the editor. Today it is possible to upload images directly with the editor, but it is not possible to remove them in the modal window. So a delete button next to the upload button would be a great addition. At the moment it is only possible to delete an image at the image field. Best regards
      • 1
      • Like
  23. This is the solution to remove unwanted table attributes from CKEditor. Go to /wire/modules/Inputfield/InputfieldCKEditor/ckeditor-4.4.6/config.js and insert this piece of code into the config.js: CKEDITOR.on( 'dialogDefinition', function( ev ) { var dialogName = ev.data.name; var dialogDefinition = ev.data.definition; if (dialogName == 'table') { // Get the advanced tab reference var infoTab2 = dialogDefinition.getContents('advanced'); //Set the default // Remove the 'Advanced' tab completely dialogDefinition.removeContents('advanced'); // Get the properties tab reference var infoTab = dialogDefinition.getContents('info'); // Remove unnecessary bits from this tab infoTab.remove('txtBorder'); infoTab.remove('cmbAlign'); infoTab.remove('txtWidth'); infoTab.remove('txtHeight'); infoTab.remove('txtCellSpace'); infoTab.remove('txtCellPad'); infoTab.remove('txtCaption'); infoTab.remove('txtSummary'); } }); After that you have only a few attributes left. This is the best way to prevent customers from filling out useless table attributes. This works for other plugins (images, links and so on) too. A big thanks to Lostkobrakai for pointing me into the right direction.
  24. Sounds interesting, I will check this tomorrow. Thanks
  25. Hello @ all, I want to disable some of the obsolent and unnecessary attributes ot tables that CKEditor offers, because they are not HTML5 compliant or not necessary. I am talking about the summary, the border and the other attributes that CKEditor offers. I want to disable them so that customers cannot be able to use them. I am not talking about to clean up the html Markup - I can get rid of unwanted markup via a textformatter module, thats not the problem. I am talking about the table plugin button in the editor itself. If you click on that button you will be able to add borders, width, class, id and so on. I want to disable some of them, but I dont know if this is possible or not. Maybe someone can gave me a hint. Best regards Jürgen
×
×
  • Create New...