namespace Site\Pages;
class CatFiftyTwo
{
public static function getData(\XF\Pub\Controller\AbstractController $controller, \XF\Mvc\Reply\AbstractReply &$reply)
{
if ($reply instanceof \XF\Mvc\Reply\View)
{
$finder = \XF::finder('XF:schedule_match');
$reply->setParam('catinfo', $finder->fetch());
}
}
}
Hi,Here is the code I used for my testing:
PHP:<?php namespace Site\Pages; class CatFiftyTwo { public static function getData(\XF\Pub\Controller\AbstractController $controller, \XF\Mvc\Reply\AbstractReply &$reply) { if ($reply instanceof \XF\Mvc\Reply\View) { $finder = \XF::finder('XF:User')->where('user_id', '<', 100); $finder->order('username', 'ASC'); $reply->setParam('catinfo', $finder->fetch()); } } }
Attached is my settings for the page node and navigation, and as well the screenshot of the resulting output:
View attachment 229630View attachment 229631View attachment 229632
@Chris D I inserted the attachments as thumbnails, these are pretty large thumbnails...
Hi,
we need to fetch the data from our custom made table.
When we try to fetch the data from the user table it brings the data but when we try to fetch the data from the custom table, it gives an error. Do we have to define table name anywhere?
Thank you
You should get started with the dev docs and the "how to build an add-on" section to learn how to properly use the finder system.
Hi Lawrence,As @Lukas W. points out, you need to read the dev docs.
This is where I started to learn to create XF 2.x add-ons, it is an excellent tutorial: https://xenforo.com/xf2-docs/dev/lets-build-an-add-on/
</li>
(I got to play with it to be sure but graphics layouts are not my cup of tea): <xf:foreach loop="$navTree" key="$navSection" value="$navEntry" i="$i" if="{{ $navSection != $xf.app.defaultNavigationId }}">
<li>
<xf:macro name="nav_entry"
arg-navId="{$navSection}"
arg-nav="{$navEntry}"
arg-selected="{{ $navSection == $pageSection }}"
arg-shortcut="{$i}" />
</li>
</xf:foreach>
Hi Lawrence,AdminCP -> Appearance -> Templates -> select your style from the drop down -> PAGE_CONTAINER
Making changes here will stick, even during upgrades. The only time changes will be lost is if you manually select toRevert
the template.
We use essential cookies to make this site work, and optional cookies to enhance your experience.