Inline content not working with PHP code

Search
Other Bug Reports questions
Forum

Inline content not working with PHP code

Patrizia Temporini's Avatar Patrizia Temporini
Hello, i have a dynamic PHP page with code using Sourcerer component.
I have just purchased the PRO version of Modal component and upgraded to v12.6.1.
When i try to open the link that i have with inline content the popup doesn't show, it just does nothing (the browser console gives no errors).

This is a part of the code to give idea:
{source raw="true"}
[[?php

$coll141neterrors = file_get_contents('c:/xampp/htdocs/1_4_1/errori/FullRebuildNetaSIU_Errors.log');

echo "<div style='display: none'>";
	echo "<div id='coll141neterrors' style='padding:20px;'>";
		echo substr($coll141neterrors,0,5000);
	echo "</div>";
echo "</div>";

echo "<a class='modal_link linkeffect' data-modal-class-name='no_title' data-modal-inline='true' href='#coll141neterrors'>dettaglio errori</a>";

?]]
{/source}

What i want to achieve is that the popup must show the content of the log text file set in the variable.
Im using Joomla v3.10.12.

Side note: using an old (free) version of Modals 9.8.1 works without problems.
Peter van Westen's Avatar Peter van Westen ADMIN
Just use the inline content tags available in Modals:
docs3.regularlabs.com/modals/content/inl...separate-content-tag
{modal content="coll141neterrors">dettaglio errori{/modal}
{modalcontent coll141neterrors}
{source}<?php
   $coll141neterrors = file_get_contents('c:/xampp/htdocs/1_4_1/errori/FullRebuildNetaSIU_Errors.log');
   echo substr($coll141neterrors,0,5000);
?>{/source}
{/modalcontent}
Please post a rating at the Joomla! Extensions Directory
Patrizia Temporini's Avatar Patrizia Temporini
Thanks Peter, but the page has complex PHP code and the popup link to display is inside an if else cycle, i made various tests but it's impossible to use the special Modal tags.

There are no chances to use HTML tags instead which gives much more "flexibility" to open the popup?

Anyway the problem seems related only using the HTML code for the popup inside PHP code.
If i use the following code in a normal article (so not inside PHP code) it works perfectly:
<p>
  <div style="display:none;"><div id="mycontent">
    <p>
      <span class="importante">testo</span>, altro testo
    </p>
</div></div>

<a class="modal_link linkeffect" data-modal-class-name="no_title" data-modal-inline="true" href="#mycontent">test</a>
</p>
Peter van Westen's Avatar Peter van Westen ADMIN
Use double quotes for the html attributes instead of single quotes.
Also make sure the ids for the modal content blocks are unique.

PS: you can also output {modal} and {modalcontent} tags through php using Sourcerer.
In that case make sure to use a correct system plugin ordering.
See: regularlabs.com/blog/242-plugin-order-is-important
Please post a rating at the Joomla! Extensions Directory
Patrizia Temporini's Avatar Patrizia Temporini
Using double quotes instead single quotes it worked, thanks!
You can only post on this forum if you log in