[GELÖST] News Seitentitel

Hilfe zu Modulen und Tags
Post Reply
jff
New Member
New Member
Posts: 2
Joined: Fri Feb 21, 2014 7:11 pm

[GELÖST] News Seitentitel

Post by jff »

Hallo,

im Augenblick habe ich ein kleines Problem.

Beim anzeigen eines Newsartikels wird der Seitentitel der zuletzt angezeigten
Seite (z.B. "Impressum") angezeigt.

CMS-Version 1.11.10
News-Version 2.14.2

Any hints? ??? ???

Danke im Voraus.

Jörg



----------------------------------------------

Cms Version: 1.11.10

Installed Modules:

CMSMailer: 5.2.2
CMSPrinting: 1.0.5
FileManager: 1.4.4
MenuManager: 1.8.6
ModuleManager: 1.5.5
News: 2.14.2
Search: 1.7.11
ThemeManager: 1.1.8
TinyMCE: 2.9.12
MicroTiny: 1.2.6


Config Information:

php_memory_limit:
process_whole_template:
max_upload_size: 2000000
url_rewriting: none
page_extension:
query_var: page
image_manipulation_prog: GD
auto_alias_content: true
locale:
default_encoding: utf-8
admin_encoding: utf-8
set_names: true


Php Information:

phpversion: 5.4.9-4ubuntu2.4
md5_function: An (Ja)
gd_version: 2
tempnam_function: An (Ja)
magic_quotes_runtime: Aus (Nein)
E_STRICT: 0
E_DEPRECATED: 0
memory_limit: 128M
max_execution_time: 30
output_buffering: 4096
safe_mode: Aus (Nein)
file_uploads: An (Ja)
post_max_size: 8M
upload_max_filesize: 2M
session_save_path: Keine Prüfung, da eine „open basedir“-Beschränkung aktiviert ist
session_use_cookies: An (Ja)
xml_function: An (Ja)
xmlreader_class: An (Ja)


Server Information:

Server Api: cgi-fcgi
Server Db Type: MySQL (mysqli)
Server Db Version: 5.5.34
Server Db Grants: Gefunden eine "Alles gewähren"-Anweisung, die als geeignet scheint
Server Time Diff: Keine Abweichung der Zeit im Dateisystem gefunden


----------------------------------------------
Last edited by jff on Sun Feb 23, 2014 11:26 am, edited 1 time in total.
JohnnyB
Dev Team Member
Dev Team Member
Posts: 729
Joined: Tue Nov 21, 2006 5:05 pm
Location: OH, USA

Re: News Seitentitel

Post by JohnnyB »

Set the default detail page option for the module and set a deatilpage='' parameter in the {News} tag.

Also, you can set up your page to use the article's title instead of the landing page's title.

1) Add to your News Detail template

Code: Select all

{assign var='articleTitle' value=$entry->title|cms_escape:htmlall}
2) Add to the very top of your layout Template

Code: Select all

{if isset($articleTitle)}{capture assign='Title'}{$articleTitle}{/capture}{else}{capture assign='Title'}{title}{/capture}{/if}
3) Use {$Title} in your template's body instead of {title}

4) Add this to your content page's Metadata to use the article's title in the metadata

Code: Select all

<title>{if isset($articleTitle)}{$articleTitle}{else}{title} - {sitename}</title>
"The art of life lies in a constant readjustment to our surroundings." -Okakura Kakuzo

--
LinkedIn profile
--
I only speak/write in English so I may not translate well on International posts.
--
uniqu3

Re: News Seitentitel

Post by uniqu3 »

Hallo und Willkommen,

in der Regel mache ich es so, dass ich das {title} CMSMS Smarty tag so wie auch {content} Tag ganz am anfang des Templates an eine Smarty variable übergebe, sprich "assign".

Zum beispiel:

Code: Select all

{strip}{process_pagedata}

{* assign title and content to variable *}
{title assign='main_title'}
{content assign='main_cotnent'}

{/strip}<!doctype html>
Danach müssen {content} und {title} Tags weiter unten im Template ersetzt werden, auf jeden Fall {content}, denn dieses kann nur einmal als solches ohne "block" Parameter verwendet werden.

Code: Select all

<!-- dein template -->
<h1>{$main_title nocache}</h1>
{$main_content nocache} {* nocache parameter da variablen mit Smarty caching zwischengespeichert werden und zu merkwürdigen Resultaten führen können *}
<!-- dein template -->
Wenn das so eingerichtet ist, muss nur noch die News überschrift ebenfalls an eine variable im Detail-Template übergeben werden.
{* am besten gleich am anfange des Detail-Templates um Logik vom Layout zu trennen *}

{$main_title = $entry->title}

<!-- und der rest -->
Damit dürfte Seitenüberschrift mit News Überschrift erscheinen, wobei Du aber besser noch denn "detailpage" Parameter und eine "News" Detailseite verwenden solltest, um Indexierung mehrere URL's für ein und das selbe Beitrag zu vermeiden.

Für eine weitere Methode kannst Du dir noch diesen Artikel http://www.i-do-this.com/snippets/Setti ... s-title/56 ansehen.
jff
New Member
New Member
Posts: 2
Joined: Fri Feb 21, 2014 7:11 pm

Re: News Seitentitel

Post by jff »

Hi,

@uniqu3: Danke das war es.

@JohnnyB: Thanks for your work

Nice weekend

Jörg
Post Reply

Return to “Module und Tags”