Skip to main content

Flexbox layout met siblings

More
8 years 4 months ago #4028 by gobrightnl
Beste allemaal,

Allereerst mijn respect naar Bram dat je na al die jaren nog steeds service en feedback verleend. Ik gebruik je component al jaren met veel plezier.

Ik wil eigenlijk op mijn website de mcol of flexbox layout gebruiken, maar dan wel met daaronder het stukje 'siblings' script die ik nu ook gebruik. De eigenlijk de titel, daaronder de foto, daaronder een viertal prijsvergelijkingen uit verechillende webwinkels. Ik heb zelf al twee nachten lopen klooien met scriptjes maar ik ben niet zo'n gevorderde php specialist...

Ik gebruik nu de full layout op mn website www.blocksnbricks.nl


Alvast bedankt voor jullie hulp!

Please Log in to join the conversation.

More
8 years 4 months ago #4029 by redactie
in essentie is het niet veel meer dan het siblings lusje uit de full overzetten naar de flexbox. Hoe ziet je huidige full eruit?

Please Log in to join the conversation.

More
8 years 4 months ago - 8 years 4 months ago #4031 by gobrightnl
Mijn huidige full ziet er zo uit, ik heb inderdaad al geprobeerd om code te kopieeren en plakken in de flexbox file maar krijg het niet voor elkaar.

Alvast bedankt voor je tijd.


Code:
<?php // no direct access defined('_JEXEC') or die('Restricted access'); echo '<div id="com_datafeeds">'; # # Copyright brambring.nl # https://www.affiliatefeeds.nl # joomla@brambring.nl # filename components/com_datafeeds/views/items/tmpl/default_siblings.php if ($this->pagination ) { $links= $this->pagination->getPagesLinks(); echo '<div class="pagination" id="datafeeds_top">'.$links.'</div>'; } echo '<div class="datafeeds_clear">'; foreach ( $this->dataitems as $item ) { $product_title=$item['title']; $product_url=JRoute::_( $this->where['baselink']."&". make_urlencoded(array("qt"=>$product_title))); echo '<div class="datafeeds">'; $this->assignRef('siblings', $this->get( 'Siblings')); $this->assignRef('siblingfield', $this->get( 'Siblingfield')); echo '<h2>'.$product_title.'</a></h2> <div class="datafeeds_description">'. $item['description']; if ( is_array($this->siblings[$item[$this->siblingfield]] ) ) { $siblings=&$this->siblings[$item[$this->siblingfield]]; } else { $siblings=array(&$item); } foreach ( $siblings as $sibling ) { echo '<p class="datafeeds_more"></br>Actuele prijs bij <a class="dflink" href="'. $sibling['url'] .'" target="_blank" rel="nofollow" title="'. $item['title'] .'">'.$sibling['feed'] .':&nbsp;' ; if ( $sibling['pprijs'] > 0 ) { printf ('<span>'.$this->where['currency_sign'].' %2.2f</span>',$sibling['pprijs']); } echo "</a></p>"; } echo '</div>'; echo '<img class="datafeeds_img" src="'. $item['image'].'" alt="'.$product_title.'" '.$this->geen_img_script.'/>'; echo '<div class="datafeeds_clear datafeeds_fix">&nbsp;</div>'; echo '</div>'; } ?>

Last edit: 8 years 4 months ago by redactie.

Please Log in to join the conversation.

More
8 years 4 months ago #4032 by redactie
in essentie zie ik geen problemen met de code,

de get-siblings mag buiten de foreach, en de joomlafunctie assignref geeft php warnings.
met een beetje schuiven en aanpassen krijg je dan onderstaande.

j3.gryla.biz/submenu
Code:
<?php // no direct acce defined('_JEXEC') or die('Restricted access'); echo '<div id="content">'; echo '<div id="products">'; # # Copyright brambring.nl # https://www.affiliatefeeds.nl # joomla@brambring.nl $currency=$this->where['currency_sign']; $more_text=$this->where['read_more']; $siblings= $this->get( 'Siblings'); $siblingfield=$this->get( 'Siblingfield'); if ($this->pagination ) { $links= $this->pagination->getPagesLinks(); echo '<div class="pagination df-clearfix">'.$links.'</div>'; } echo '<ul>'; foreach ($this->dataitems as $item ) { $product_title=$item['title']; $product_id=$item['items_id']; $feed=$item['feed']; $alt=df_alt($item['title']); $product_ref=$item['url']; $product_price=$item['Prijs']; $product_image=$item['image']; echo '<li>'; echo '<a target="_blank" href="'.$product_ref.'" rel="nofollow">'; echo '<h2>'.$product_title.'</h2>'; echo '<img class="product" src="'.$product_image.'" alt="'.$alt.'" /></a>'; if ($product_price > 0 ) { $price_formated=$currency.' '.money_format('%!.2n', $product_price); '</a></p>'; } else { $price_formated='&nbsp'; } echo '<p class="df-price">'.$price_formated.'</p>'; if ( isset($siblings[$item[$siblingfield]] ) ) { $itemsibs=&$siblings[$item[$siblingfield]]; } else { $itemsibs=array(&$item); } echo '<p class="df-button">'; foreach ( $itemsibs as $sibling ) { $ref=$sibling['url']; $feed=$sibling['feed']; $prijs=$sibling['Prijs']; echo '<a target="_blank" href="'.$ref.'" rel="nofollow"> Koop bij ' . $feed.'(&euro;'.$prijs.')</a><br/>'; } echo '</p>'; echo'</li>'; } echo '</ul>'; if ($this->pagination ) { echo '<div class="pagination df-clearfix">'.$links.'</div>'; } echo '</div>'; ?> <style> #products > ul:after { clear: both; content: ""; display: block; } #products > ul li { width:200px; float:left; margin: 0 15px 15px 0; padding: 0; position: relative; flex:1 0 auto; text-align:center; } #products > ul img{ margin-bottom:35px; max-width:200px; } #products > ul { flex-wrap: wrap; justify-content: space-around; display: flex; list-style: outside none none; margin: 0; padding: 0; } #products .df-price { position:absolute; bottom:35px; right:-5px; border-radius: 2px; font-weight:bold; background-color: white; border: 1px solid blue; display: block; font-size: 15px; font-weight: normal; height: 20px; line-height: 20px; padding: 2px; position: absolute; z-index: 5; } #products .df-button a { color: #fff; } #products .df-button{ background: none repeat scroll 0 0 blue; color: #fff; border-radius: 2px; font-style: normal; display:block; margin:0px auto; width:90%; overflow:hidden; /*height: 22px;*/ left: 10px; line-height: 22px; overflow: hidden; padding: 0 5px; text-align: center; text-overflow: ellipsis; white-space: nowrap; position:absolute; bottom:5px; } .df-clearfix:before, .df-clearfix:after { content: " "; display: table; } .df-clearfix:after { clear: both; } .pagination { text-align:center; } #products h2 { line-height:1em; font-size:14px; overflow:hidden; } </style> </div>

Please Log in to join the conversation.

More
8 years 4 months ago #4044 by gobrightnl
Bram,

Dit script werkt perfect! Wederom super bedankt voor de moeite. Ik ben hier erg blij mee.

mvg,

Please Log in to join the conversation.

More
8 years 4 months ago - 8 years 4 months ago #4045 by gobrightnl
Hai Bram,

De weergave van het script is perfect! Heb deze nog iets aangepast met css. Het valt mij op dat met deze weergave, de prijs in het 'losse vakje' niet altijd de goedkoopste prijs is.

Ik mijn geval wordt eigenlijk altijd de prijs van één en dezelfde winkel weergeven als 'goedkoopste' prijs.

Hoe kan ik dit veranderen zodat ik het 'losse vakje' altijd de goedkoopste prijs komt te staan van een product?


zie de foto:



Alvast bedankt voor je hulp.


mvg,

Jordy
Last edit: 8 years 4 months ago by gobrightnl.

Please Log in to join the conversation.

Time to create page: 0.492 seconds