Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contao 4.10 fixes #61

Merged
merged 6 commits into from Sep 14, 2020
Merged

Contao 4.10 fixes #61

merged 6 commits into from Sep 14, 2020

Conversation

Sioweb
Copy link
Contributor

@Sioweb Sioweb commented Sep 1, 2020

This will fix the no root page found #60

Im not sure which contao version is required for $objPage->getFrontendUrl or PageModel::getFrontendUrl. Maybe 4.8?

@Sioweb Sioweb changed the title Update ModuleTagCloud.php No root page found fix Sep 1, 2020
@Sioweb Sioweb changed the title No root page found fix Contao 4.10 fixes Sep 1, 2020
@jankout
Copy link

jankout commented Sep 3, 2020

Thank you very much.

@hschottm Can you implement it, please?

@jankout
Copy link

jankout commented Sep 8, 2020

@Sioweb Es gibt noch ein Problem mit der URL in mod_tagcloud.html5, sobald die Rootseite ein Sprachensuffix und eine eingetragene Domain hat. Weißt du zufällig, was man ändern muss. Siehe https://www.allesbrille-berlin.com/de/kontakt (ganz unten ist die Tagcloud).

Ich habe es temporär hinbekommen, indem ich die URL manuell hard eingetragen haben

<ul class="cloud"<?php echo (($this->topten && !$this->expandedAll) ? ' style="display: none;"' : ''); ?>>
<?php foreach ($this->tags as $tag): ?>
	<li class="<?php echo $tag['tag_class']; ?>">
<?php if (strlen($this->jumpTo)): ?><a href="tags/tag/<?php echo $tag['tag_name']; ?>" 
title="<?php echo $tag['tag_name'] . ' (' . $tag['tag_count'] . ')'; ?>">
<?php endif; ?><?php echo $tag['tag_name']; ?><?php if (strlen($this->jumpTo)): ?></a><?php endif; ?></li>
<?php endforeach; ?>
</ul>

Es geht um tags/tag/<?php echo $tag['tag_name']; ?>. Ursprünglich ist es mit <?php echo $tag['tag_url']; ?>

@Sioweb
Copy link
Contributor Author

Sioweb commented Sep 9, 2020

@jankout Bei mir hat das zunächst auch nicht funktioniert, ich glaube nach dem ich das Verzeichnis /var/cache gelöscht habe, hat es funktioniert.

In der Datei /Hschottm/Tags/modules/ModuleTagCloud.php Zeile 114 wird die URL zusammengesetzt, im Template muss nichts angepasst werden.

Zum Debuggen habe ich bei mir lokal mal folgendes in Zeile 112 - 128 eingetragen:

			if (count($pageArr))
			{
				echo '<pre>' . __METHOD__ . ":\n" . print_r($objPage->getFrontendUrl(), true) . "\n#################################\n\n" . '</pre>';
				die('<pre>' . __METHOD__ . ":\n" . print_r($objPage->getFrontendUrl('/tag/' . \TagHelper::encode($tag['tag_name'])), true) . "\n#################################\n\n" . '</pre>');
				$strUrl = StringUtil::ampersand($objPage->getFrontendUrl('/tag/' . \TagHelper::encode($tag['tag_name'])));
				if (strlen($strParams))
				{
					if (strpos($strUrl, '?') !== false)
					{
						$strUrl .= '&amp;' . $strParams;
					}
					else
					{
						$strUrl .= '?' . $strParams;
					}
				}
			}

Das sollte dann eine weiße Seite erzeugen mit dem Inhalt:

Contao\ModuleTagCloud::showTags:
de/newsarchiv.html
#################################

Contao\ModuleTagCloud::showTags:
de/newsarchiv/tag/TAGNAME.html
#################################

@hschottm hschottm merged commit 74f7ae1 into hschottm:master Sep 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants