Kunena Menu
<script>...</script> not working in PB modules
- trogladyte
- Topic Author
- Offline
- Platinum Member
-
5 years 5 months ago #60849
by trogladyte
A good landing is one you can walk away from.
A great landing is one where you can reuse the aircraft!
<script>...</script> not working in PB modules was created by trogladyte
I have been using the following code, in conjunction with the extension DirectPHP to insert the current year in the copyright:
With Joomla 4, there is no plans to update DirectPHP to be compatible, so, I have started using the following code to accomplish the job.
However, if I use it in a PB module, I can enter it, but when I save out of the text block, the year (2021) is shown on a white page. only. If I refresh, I get the admin page back and nothing was saved. If I use a code block it works fine. If it's in a Custom HTML module it's fine. I'd prefer to use a regular text block over a code block. Why will the text block not work?
Code:
{?php echo date("Y"); ?}
With Joomla 4, there is no plans to update DirectPHP to be compatible, so, I have started using the following code to accomplish the job.
Code:
<script>document.write( new Date().getFullYear() );</script>
However, if I use it in a PB module, I can enter it, but when I save out of the text block, the year (2021) is shown on a white page. only. If I refresh, I get the admin page back and nothing was saved. If I use a code block it works fine. If it's in a Custom HTML module it's fine. I'd prefer to use a regular text block over a code block. Why will the text block not work?
A good landing is one you can walk away from.
A great landing is one where you can reuse the aircraft!
Please Log in or Create an account to join the conversation.
5 years 5 months ago #60855
by ced1870
Joomlack Webmaster and Developer
Replied by ced1870 on topic <script>...</script> not working in PB modules
Hi
have you tried the "code" addon ? this is the one that you shall use to put some PHP code for example
CEd
have you tried the "code" addon ? this is the one that you shall use to put some PHP code for example
CEd
Joomlack Webmaster and Developer
Please Log in or Create an account to join the conversation.
- trogladyte
- Topic Author
- Offline
- Platinum Member
-
5 years 5 months ago #60935
by trogladyte
A good landing is one you can walk away from.
A great landing is one where you can reuse the aircraft!
Replied by trogladyte on topic <script>...</script> not working in PB modules
Yes, that's what I've started doing. I just wondered why the text block was stripping the script.
A good landing is one you can walk away from.
A great landing is one where you can reuse the aircraft!
Please Log in or Create an account to join the conversation.
Time to create page: 0.205 seconds





