Views eigene DIV Container
![](http://www.drupalcenter.de/files/noavatar_mini.gif)
am 24.10.2013 - 12:51 Uhr in
Die Frage ist jetzt wie schaffe ich das mit VIEW umzusetzen als Block?
Habe schon mit dem Views Slider versucht aber das Ergebnis ist miserabel.
Habe schon nach Lösungen gesucht finde aber einfach nichts.
Ich bräuchte wie die page.tpl.php einfach eine Template Datei für einen bestimmten View Block.
<div id="featured_slide">
<div class="wrapper">
<div class="featured_content">
<ul id="accordion">
<li class="current">
<div class="featured_box">
<h2>[TITEL]</h2>
<p>[INHALT]</p>
<p class="readmore"><a href="#">[READMORE]</a></p>
</div>
<div class="featured_tab"> <img src="images/demo/100x100.gif" alt="" />
<p>[TABUBERSCHRIFT]</p>
</div>
</li>
<li class="current">
<div class="featured_box">
<h2>[TITEL]</h2>
<p>[INHALT]</p>
<p class="readmore"><a href="#">[READMORE]</a></p>
</div>
<div class="featured_tab"> <img src="images/demo/100x100.gif" alt="" />
<p>[TABUBERSCHRIFT]</p>
</div>
</li>
</ul>
</div>
</div>
</div>
- Anmelden oder Registrieren um Kommentare zu schreiben
Hallo Dominik, um dein
am 24.10.2013 - 15:18 Uhr
Hallo Dominik,
um dein eigenes Template in Views zu verwenden klickst du in deinem View unter "Advanced" > "Other" auf "Theme: Information".
Dann erscheint ein Popup der dir vorgibt wie deine Template-Datei zu heißen hat um erkannt und verwendet zu werden.
Gruß Luca
Hier zum
am 24.10.2013 - 15:57 Uhr
Hier zum Beispiel:
http://drupal.stackexchange.com/questions/11468/create-template-file-for...
Beim kopieren bzw. Anlegen auf den -- im Dateinamen achten!
Grüße Jenna
Das ist der Code aus der
am 27.10.2013 - 11:20 Uhr
Das ist der Code aus der Unformatted List aber ich brauche ja mehrere Variablen daraus...
EDIT// Ich stehe total auf dem Schlauch das Design stimmt schon mal aber es werden keine Inhalte Angezeigt...
Meine "views-view-unformatted--highlight--block.tpl.php" Datei.
<?php
/**
* @file
* Default simple view template to display a list of rows.
*
* @ingroup views_templates
*/
?>
<div id="featured_slide">
<div class="wrapper">
<div class="featured_content">
<ul id="accordion">
<?php foreach ($rows as $id => $row): ?>
<li class="current">
<div class="featured_box">
<h2><?php print $row['title'];?></h2>
<p><?php print $row->body;?></p>
<p class="readmore"><a href="<?php print $row->link;?>"> <?php print $row->linkbeschreibung;?></a></p>
</div>
<div class="featured_tab"> <?php print $row->bild;?>
<p><?php print $row->tab_title;?></p>
</div>
</li>
<?php endforeach; ?>
</ul>
</div>
</div>
</div>
EDIT// Habe bis jetzt immer noch keine Lösung gefunden nur das die Inhalte erscheinen aber Total unformatiert... Finde keinen Richtigen Ansatz um das Problem zu lösen.
views-view-unformatted-highlight-block.tpl.php
<?php
/**
* @file
* Default simple view template to display a list of rows.
*
* @ingroup views_templates
*/
?>
<?php foreach ($rows as $id => $row): ?>
<?php print $row;?>
<?php endforeach; ?>
views-view-fields.tpl.php
<?php
/**
* @file
* Default simple view template to all the fields as a row.
*
* - $view: The view in use.
* - $fields: an array of $field objects. Each one contains:
* - $field->content: The output of the field.
* - $field->raw: The raw data for the field, if it exists. This is NOT output safe.
* - $field->class: The safe class id to use.
* - $field->handler: The Views field handler object controlling this field. Do not use
* var_export to dump this object, as it can't handle the recursion.
* - $field->inline: Whether or not the field should be inline.
* - $field->inline_html: either div or span based on the above flag.
* - $field->wrapper_prefix: A complete wrapper containing the inline_html to use.
* - $field->wrapper_suffix: The closing tag for the wrapper.
* - $field->separator: an optional separator that may appear before a field.
* - $field->label: The wrap label text to use.
* - $field->label_html: The full HTML of the label to use including
* configured element type.
* - $row: The raw result object from the query, with all data it fetched.
*
* @ingroup views_templates
*/
?>
<div id="featured_slide">
<div class="wrapper">
<div class="featured_content">
<ul id="accordion">
<?php print $field->wrapper_prefix; ?>
<?php print $field->label_html; ?>
<li class="current">
<div class="featured_box">
<h2><?php print $fields['title']->content;?></h2>
<p><?php print $fields['body']->content;?></p>
<p class="readmore"><a href="<?php print $fields['field_link']->content;?>"> <?php print $fields['field_linkbeschreibung']->content;?></a></p>
</div>
<div class="featured_tab"> <?php print $fields['field_bild']->content;?>
<p><?php print $fields['field_tab_title']->content;?></p>
</div>
</li>
<?php print $field->wrapper_suffix; ?>
</ul>
</div>
</div>
</div>