LISE category Link to Detals sends to backoffice

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
janvl
Power Poster
Power Poster
Posts: 989
Joined: Wed Aug 13, 2008 10:57 am

LISE category Link to Detals sends to backoffice

Post by janvl »

Hi,
I have a website https://paed2.gerdalink.top where a LISE-instance is running.
CMSMS 2.2.22
LISE 1.5.6
PHP 8.1.32

When i click on "Kinderdermatologie bundesweit -> sortiert nach Regionen"
i get a list of all categories (regionen) with the number of items.
When i click on one of the links it points to the backoffice:
https://paed2.gerdalink.top/admin/modul ... il=details

I cannot find a cause for this behaviour and solve it.

If you do the same on https://paed2.gerdalink.top
CMSMS 2.2.16
LISE 1.5.6
PHP 7.4.33
it works as expected.

Where can i search to solve this?

Regards,
Jan
User avatar
webform
Power Poster
Power Poster
Posts: 531
Joined: Sat Nov 25, 2006 3:39 pm

Re: LISE category Link to Detals sends to backoffice

Post by webform »

What does your Category Template looks like?

And have you tried the default Category Template and see if the problem persist?
janvl
Power Poster
Power Poster
Posts: 989
Joined: Wed Aug 13, 2008 10:57 am

Re: LISE category Link to Detals sends to backoffice

Post by janvl »

Hello webform,

Thanks for reacting so fast!

LISE is called with this Smarty - i made it in paed.gerdalink.top and copied it to paed2.gerdalink.top:
{LISEFachkraefte action = category template_summary = 'zusammenfassung' template_detail = 'details'}

Category Template "zusammenfassung":

Code: Select all

<div>
{if $items|@count > 0}
	<!-- items -->
	{foreach from=$items item=item}
	<!-- item -->
        <div class="item-title" style="color:#333;padding:5px;font-size:120%;">
        <b>{$item->fielddefs.stadt.value|cms_escape}: <a href="{$item->url}">{$item->fielddefs.name.value|cms_escape}</a></b>
        </div>
        <div style="border-top:1px solid #d2d2d2;margin:0.5em 0 0.5em 0 ;height:5px;">
        </div>
	<!-- item //-->
	{/foreach}

	<!-- items //-->
{/if}
</div>

Category Template "details":

Code: Select all

<!-- item -->
<div class="item">
Region: {LISELoader item='category' force_array=1 value=$item->fielddefs.category assign='cats'}{$category = "{$cats|implode:','}"}{$category}
<br />
	<h2 class="item-title">{$item->name|cms_escape}</h2><br />
<br /> 
<b>{$item->facharzt|replace:",":", "} {$item->fielddefs.klinik_oder_praxis.value|cms_escape} </b><br />
<br />
<b>Adresse:</b> <br />
{$item->fielddefs.adressenzusatz.value|cms_escape}<br />
{$item->fielddefs.adresse.value|cms_escape}<br />
<br />
<b>Kontakt:</b><br />
Telefon:{$item->fielddefs.telefon.value|cms_escape}<br />
<br />
E-Mail-Adresse: <a href="mailto:{$item->fielddefs.kontaktemail.value|cms_escape}">{$item->fielddefs.kontaktemail.value|cms_escape}</a><br />
<br />
Webseite: <a href="{$item->fielddefs.webseite.value|cms_escape}" target="_blank">{$item->fielddefs.webseite.value|cms_escape}</a><br />
<br />
<table style="border: 1px solid #333;border-collapse:collapse;">
<tr><td style="border: 1px solid #333;padding:10px;"><h5>Sprechstunde</h5></td><td style="border: 1px solid #333;padding:10px;"><h5>Praxisprofil</h5></td></tr>
<tr><td style="width:45%;vertical-align: top;border: 1px solid #333;padding:10px;">{$item->fielddefs.details.value}</td><td style="width:45%;vertical-align: top;border: 1px solid #333;padding:10px;">{$item->fielddefs.schwerpunkte.value}</td></tr>
</table>
<br /><br />

<div id='mymap' style='width:75%;height:400px;'></div>
{literal}
<__script__>
      // initialize Leaflet
      var mymap = L.map('mymap').setView({lon: {/literal}
{$item->fielddefs.laengengrad.value|cms_escape} , lat: 
{$item->fielddefs.breitengrad.value|cms_escape}{literal}
}, 12);

      // add the OpenStreetMap tiles
      L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
        maxZoom: 19,
        
        	attribution: 'Map data &copy; <a href="https://openstreetmap.org">OpenStreetMap</a> contributors, ' +
			'<a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
			'Imagery © <a href="https://mapbox.com">Mapbox</a>',
		id: 'mapbox.streets'
	}).addTo(mymap);
 
      // show the scale bar on the lower left corner
      L.control.scale().addTo(mymap);

      // show a marker on the map
      L.marker({lon: {/literal}
{$item->fielddefs.laengengrad.value|cms_escape} , lat: 
{$item->fielddefs.breitengrad.value|cms_escape} {literal}
}).bindPopup({/literal}
'{$item->fielddefs.name.value|cms_escape:htmlall}<br />{$item->fielddefs.strasse.value|cms_escape:htmlall}<br />{$item->fielddefs.postleitzahl.value|cms_escape:htmlall} {$item->fielddefs.stadt.value|cms_escape:htmlall}<br />{$item->fielddefs.telefon.value|cms_escape:htmlall}'
{literal}).addTo(mymap).openPopup();

</__script>
{/literal}


<br /><br />
	<a href="{$return_url}" class="return-link">return</a>
	{* or use {$return_link} to create link tag *}
	
</div>
<!-- item //-->
User avatar
webform
Power Poster
Power Poster
Posts: 531
Joined: Sat Nov 25, 2006 3:39 pm

Re: LISE category Link to Detals sends to backoffice

Post by webform »

Your Category Template looks wrong - It looks like your using a Summary Template code. The default Category Template looks like this:

Code: Select all

<!-- categories -->
<ul>
{foreach from=$categories item=category}
	<li class="category-{$category->alias}">
		<a class="category-name" href="{$category->url}">{$category->name} ({$category->items|count})</a>
			{if !empty($category->description)}
			<div class="category-description">
				{eval var=$category->description}
			</div>
			{/if}
	</li>
{/foreach}
<ul>
<!-- categories //-->
And your calling a summary and detail template in your LISEInstance tag, which is ignored when using action='category'.
The category action using summary and detail templates that is set to default in the template list.
janvl
Power Poster
Power Poster
Posts: 989
Joined: Wed Aug 13, 2008 10:57 am

Re: LISE category Link to Detals sends to backoffice

Post by janvl »

When i call LISE with
{LISEFachkraefte action = category}
so the default category-template is used i get the list with different categories and when i click a category i get a list with all the details for each item.
Then there is a Link "more" when i click that i get:

- - - -
https://paed2.gerdalink.top/admin/modul ... ierarchy=7 hat möglicherweise ein temporäres Problem oder ist umgezogen.

Fehlercode: 500 Internal Server Error
- - - -

So exactly the same error, pointing to the backoffice instead of pointing to the details of the selected item.

I do wonder where LISE takes the link to the backoffice.

Regards,
Jan
janvl
Power Poster
Power Poster
Posts: 989
Joined: Wed Aug 13, 2008 10:57 am

Re: LISE category Link to Detals sends to backoffice

Post by janvl »

when i use {LISEFachkraefte debug = 1}
there is a "more" link that is correct.
User avatar
webform
Power Poster
Power Poster
Posts: 531
Joined: Sat Nov 25, 2006 3:39 pm

Re: LISE category Link to Detals sends to backoffice

Post by webform »

Try to look in your error log what triggers the error?

Alternative try install https://dev.cmsmadesimple.org/projects/logwatch and trigger the error again and the go to the LogWatch module and see the error message. It should tell you what triggers the error.

Also try to set all LISEFachkraefte templates (category, summary and detail) to default and see if the error goes away. It could be your Leaflet script that triggers the error.
User avatar
webform
Power Poster
Power Poster
Posts: 531
Joined: Sat Nov 25, 2006 3:39 pm

Re: LISE category Link to Detals sends to backoffice

Post by webform »

Another thing to test is to go to your {LISEFachkraefte} => Settings Tab and under Module defaults try change the settings for Detail page & Summary page (Remember to save).
If the setting is set to None, change it to some page alias and save. If no errors, try change back and save and test again.
Post Reply

Return to “Modules/Add-Ons”