Search
Other Articles Anywhere questions
Forum

Incorrect behavior when inserting user-defined fields.

Peter Hellinger's Avatar Peter Hellinger
Joomla 5.1.0, php 8.2/8.3, Articles Anywhere 16.0.5 PRO.

When inserting user-defined fields, an unwanted leading space occurs if :text or layout="false" is used. Example:
<div class="produkt-item" data-produkt="[produktnummer:text]">
    <div class="bild" uk-lightbox><a href="[image-intro:url]">[image-intro]</a><i class="fas fa-search-plus"></i></div>   
    <div class="text">[text]</div>    
    <div class="preis">€[preis layout="false"]</div>
    <div class="anzahl">
      <select name="anzahl" id="anzahl-[produktnummer layout='false']">
        <option value="1">1 Stück</option>
        <option value="2">2 Stück</option>
        <option value="3">3 Stück</option>
        <option value="4">4 Stück</option>
        <option value="5">5 Stück</option>
        <option value="6">6 Stück</option>
        <option value="7">7 Stück</option>
        <option value="8">8 Stück</option>
        <option value="9">9 Stück</option>
        <option value="10">10 Stück</option>
        <option value="0">Löschen</option>
      </select>
    </div>
    <div class="cart"><a href="#" id="cart-[produktnummer layout='false']"
      data-produkt="[produktnummer layout='false']" 
      data-name="[title]" 
      data-preis="[preis layout='false']"
      data-stueck="1">In den Warenkorb</a></div>
  </div>
  {/articles}

This results in the following code in the output, pay attention to data-produkt, data-preis, id="anzahl-", id="cart-" or the div with class="preis", which are filled or supplemented by a field value.
<div class="produkt-item" data-produkt="       PN001">
    <div class="bild" uk-lightbox=""><a href="/images/produkte/Apfeltresterpulver_klein.jpg"><img src="/images/produkte/Apfeltresterpulver_klein.jpg" alt="Apfeltresterpulver Klein" title="Apfeltresterpulver Klein" width="638" height="850"></a><i class="fas fa-search-plus"></i></div>   
    <div class="text"><h5>BRAMBERGER APFELTRESTERPULVER <br>200g</h5>
<p>kann Gewebselemente von Birnen enthalten.</p>
<p>Apfeltrester enthält eine beträchtliche Menge an Ballaststoffen:&nbsp;Mehr als 40% des Apfeltresters bestehen daraus. Die gesunde Ergänzung. Zum Kochen, Backen und Roh geniessen.<br><a download="" href="/images/pdf/Plakat-Apfeltresterpulver.pdf"><i class="fas fa-file-download"></i> Infoblatt Apfeltresterpulver</a></p>
 </div>    
    <div class="preis">€       5,50</div>
    <div class="anzahl">
      <select name="anzahl" id="anzahl-       PN001">
        <option value="1">1 Stück</option>
        <option value="2">2 Stück</option>
        <option value="3">3 Stück</option>
        <option value="4">4 Stück</option>
        <option value="5">5 Stück</option>
        <option value="6">6 Stück</option>
        <option value="7">7 Stück</option>
        <option value="8">8 Stück</option>
        <option value="9">9 Stück</option>
        <option value="10">10 Stück</option>
        <option value="0">Löschen</option>
      </select>
    </div>
    <div class="cart"><a href="#" id="cart-       PN001" data-produkt="       PN001" data-name="Bramberger Apfeltresterpulver 200g" data-preis="       5,50" data-stueck="1">In den Warenkorb</a></div>
  </div>

Best regard,
Peter
Peter van Westen's Avatar Peter van Westen ADMIN
Please try the latest development version from:
regularlabs.com/development-releases
Please post a rating at the Joomla! Extensions Directory
Peter Hellinger's Avatar Peter Hellinger
Unfortunately, this does not solve the problem.

BR, Peter
Peter van Westen's Avatar Peter van Westen ADMIN
What kind of field is it? As I cannot reproduce the issue using a standard text field.
Please post a rating at the Joomla! Extensions Directory
Peter Hellinger's Avatar Peter Hellinger
These are simple text fields, output is generated in a module. Interestingly, I have an output of text fields via {article}{/article} directly in the template (Gantry5 Framework), where this effect does not occur.
Unfortunately I don't have enough time at the moment, I have to finish this work first. After that I'll try to upload a version of the site so that you can see it live. Let's leave it until then.

BR, Peter
Peter Hellinger's Avatar Peter Hellinger
A small insight: One of the text fields contains a list of numbers "10,20,30". I have output the field in {article}{/article}, read it with Javascript and converted it into an array.
var val = jQuery(this).val();
var vk = jQuery('#sys-vk-'+val).text();
var x = vk.split(',');
console.log('vk array: ', x);

The console.log output showed
Array(3) [ "\n       10", "20", "30\n" ]
There is a \n (New line) at the beginning and end of the string. Strange!

BR, Peter
Peter van Westen's Avatar Peter van Westen ADMIN
Not sure what is adding the whitespace. I cannot reproduce it here.

Can you give me (super) admin and (s)ftp access so I can take a look?
And tell me on what url I can see/reproduce the issue.
You can use the 'Confidential information' button in the forum editor to hide sensitive information.
Please post a rating at the Joomla! Extensions Directory
Peter Hellinger's Avatar Peter Hellinger
Okay, here it comes ...
Confidential information:
(hidden)


Look at the area "Onlineshop", each item has a data-produkt2 tag, that shows the white space. The product list is generated in the site module "Shop Produkte".
Peter van Westen's Avatar Peter van Westen ADMIN
Can you also give me (s)ftp access so I can take a deeper look?
Please post a rating at the Joomla! Extensions Directory
Peter Hellinger's Avatar Peter Hellinger
Here you go ...
Confidential information:
(hidden)
Peter van Westen's Avatar Peter van Westen ADMIN
Please try the latest development version from:
regularlabs.com/development-releases
Please post a rating at the Joomla! Extensions Directory
Peter Hellinger's Avatar Peter Hellinger
Okay, that works for me. 🙂

Thank you for your great work!

BR, Peter
Peter van Westen's Avatar Peter van Westen ADMIN
Ok, great 🙂
The fix will be included in the next release.
Please post a rating at the Joomla! Extensions Directory
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription