site documentation
Posted in
5
12:52 am, September 2, 2021
moving the hits widget into the post header and footer
I wanted to make a smaller deal of the views page widget, i was adding it as a full widget and it does not need to be that huge so moving from widget area to the top of the post.
Move it down into this area
I think when you first add a feature to a site, you want it to be very visible, but maybe a more subtle approach is better for things like this, as it does not really matter to the viewer how many times the page has been viewed.
PHP
// old code adding to widget
if(isset($hits->hits)) {
$hits_card = new template("card-title.html");
$hits_card->set("title", "Page Views");
$hits_card->set("content", "<p>This page has been viewed <b>$hits->hits</b> times.</p>");
$widgets->add($hits_card->output());
}
// new code adding to page template
$template->set("hits", "");
if(isset($hits->hits)) {
$template->set("hits", $hits->hits);
}
View Statistics
This Week
36
This Month
242
This Year
0
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
c testing apache apps asp bat bootstrap bootstrap templates core css css grid design elements fancybox fonts foundation framework gimp git html icons ideas images javascript jquery js linux mac nginx node php php functions php simple html dom pi400 python react sections site bugs site documentation sql sqlite sublime svg templates tools virtual box webdev windows wordpress