site documentation
Posted in
8066
1:15 am, June 11, 2021
change this to a list group - other items
Other item format is a bit average, list group should fix this.
This uses the template:
core-list-item-simple.html
So we can change this a bit to the list group format.
Which is basically this layout
HTML
<ul class="list-group">
<li class="list-group-item">An item</li>
<li class="list-group-item">A second item</li>
<li class="list-group-item">A third item</li>
<li class="list-group-item">A fourth item</li>
<li class="list-group-item">And a fifth one</li>
</ul>
as i want it to be links, need to use the same classes and links instead.
HTML
<div class="list-group">
<a href="#" class="list-group-item list-group-item-action active" aria-current="true">
The current link item
</a>
<a href="#" class="list-group-item list-group-item-action">A second link item</a>
<a href="#" class="list-group-item list-group-item-action">A third link item</a>
<a href="#" class="list-group-item list-group-item-action">A fourth link item</a>
<a href="#" class="list-group-item list-group-item-action disabled" tabindex="-1" aria-disabled="true">A disabled link item</a>
</div>
Changed templates to use the list-group.html and list-group-item.html rather than the core templates.
HTML - list-group-item.html
<a href="/view/[@class_name]/[@uid]/[@title_uid]/" class="list-group-item list-group-item-action" title='[@title]'>[@title]</a
HTML - list-group-card.html
a list group inside a card to make it neater.
<div class='card mb-3'>
<h5 class='card-header'>[@title]</h5>
<div class='card-body'>
<div class="list-group">
[@content]
</div>
</div>
</div>
Updated quite easily once i found the function.
Now it looks something like this:
Which is quite a lot nicer than the simple links and also better for mobile as you can press anywhere on the element, and makes it a bit more like buttons.
PHP
if($class->category > " ") {
$other_items_list_title = "Other Items in $class->category";
$other_items_list = $class->list_all(
$start = 0,
$max = 50,
$list_type = "category",
$template_file = "list-group-item.html",
$search_term = $class->category
);
$other_items_card_template = new template("list-group-card.html");
$other_items_card_template->set("title", $other_items_list_title);
$other_items_card_template->set("content", $other_items_list);
$page_content .= $other_items_card_template->output();
}
View Statistics
This Week
316
This Month
1121
This Year
2481
Add Comment
Other Items in site documentation
function to load one latest item with a start val load_latest_single_num
make the view number zoom when mouse over or active
moving the hits widget into the post header and footer
for auto filled fields, need to change the text and background colours
use a list group for listing by category page [todo]
Comments Listing should be a custom list rather than using search
load the latest single item only
load oldest item based on insdate then update the insdate to now - load_latest_single_update
change this to a list group - other items
hero widget header - creates a nice looking hero item from a target uid and class
dropdown section
Latest from Code Widget
Related Search Terms
Other Categories in Code
alpine js apps c css factorio font awesome images linux quick modals sqlite site bugs site updates slick slider sliders testing windows apps apache api apps asp bat bootstrap bootstrap templates charts cookies core css css filters css grid design elements docker domains emoji fancybox fonts foundation framework gimp git html icons ideas image formatting images javascript javascript functions jquery js linux mac misc modals mysql nginx node php php errors php function php functions php simple html dom pi400 python react regex sections simple_html_dom simplepie php site bugs site documentation slick slider sql sqlite ssh sublime svg svg css templates tools virtual box vscode vue webdev windows windows 11 windows commands wordpress