Member 3639
Active member
Re- your edit, yes that's what I need. Along with someone to help adjust my actual block code to include the subcategorys.
I can't help that much now (for about 8 hours) but to get to your solution, you need these elements in the template:Re- your edit, yes that's what I need. Along with someone to help adjust my actual block code to include the subcategorys.
<xen:foreach loop="$articles" value="$article">
<xen:if is="{$article.parent_id} > 0"> code for sub e.g. <li>$article.subcategory_name</li><xen:else /> code for not sub </xen:if>
</xen:foreach>
<xen:if hascontent="true">
<div class="section">
<div class="secondaryContent" id="articles" style="padding-bottom: 5px;">
<h3>Articles</h3>
<xen:contentcheck>
<xen:foreach loop="$Articles" value="$mystuff">
<p>{$mystuff.one}</p>
</xen:foreach>
</xen:contentcheck>
</div>
</div>
</xen:if>
Well this is my current template code it just needs adjusting with the block php once that is done;
HTML:<xen:if hascontent="true"> <div class="section"> <div class="secondaryContent" id="articles" style="padding-bottom: 5px;"> <h3>Articles</h3> <xen:contentcheck> <xen:foreach loop="$Articles" value="$mystuff"> <p>{$mystuff.one}</p> </xen:foreach> </xen:contentcheck> </div> </div> </xen:if>
foreach ($mystuff as &$stuff)
{
$stuff = array(
'one' => $stuff['top_name']
);
}
<xen:foreach loop="$Articles" value="$mystuff">
<xen:if is="{$mystuff.parent} == 0">
{$mystuff.top_name}<br />
<xen:else />
{$mystuff.sub_name}<br />
</xen:if>
</xen:foreach>
<?php
class EWRporta_Block_Articles extends XenForo_Model
{
public function getModule()
{
$mystuff = $this->_getDb()->fetchAll(
'SELECT
top.category_id as top_id,
top.category_name as top_name,
top.category_parent as parent,
sub.category_id as sub_id,
sub.category_name as sub_name,
sub.category_parent as parent
FROM
`articles_category` top
LEFT JOIN
articles_category sub ON sub.category_parent = top.category_id
WHERE
top.category_parent = 0
ORDER BY
top.category_name, sub.category_name
');
return $mystuff;
}
}
Try this: add thesnip
ACP (Home) ->(XenPorta) Blocks
+ Create Block
Block ID: BannerSidebar
Title: Sidebar Banner
Version String: 1.5.1
Version ID: 1
Click Save Block
Adjus Block Cache Time to satisfy your needs
View attachment 22368
Appearance -> Styles -> Master Style -> Create New Template
Template Name: EWRblock_BannerSidebar
Template data:
<div class="section">
<div class="secondaryContent" id="BannerSidebar">
<h3>It's Working</h3>
<div>
<p>I am so Happy </p>
</div>
</div>
</div>
Save all Changes
View attachment 22367
Go back to ACP (Home) -> (XenPorta) -> (Layouts) -Portal or your layout
The block that you just created is listed under Disabled Blocks in the blocks admin area.
Thanks! Never knew that.You have to put your forum into debug mode to see the Create Block.
Put this in your config file - $config['debug'] = true;
Its a very weird thing to make you have to put the whole forum into debug mode to create a block. Ive asked for that to be in the normal non debug mode to no reply.Thanks! Never knew that.
Maybe I am a bit confused but when i installed xenporta It did not include all the blocks mentioned above. Also i cant find any link to download the other blocks.
Am i missing something?
For example: I am missing the donations block/module
Is it a bug when you Export (or download through FTP) a modified Addon and when you open it up, it is the default addon.
... but just listed side by side instead of one thumb per row ...
You have to modified your Master Style.
We use essential cookies to make this site work, and optional cookies to enhance your experience.