-
Posts
2,765 -
Joined
-
Last visited
-
Days Won
40
Everything posted by Macrura
-
the blog i setup for 2 of the above has a lot of standard blog features like categories, tags, archive, feeds, comments etc; it was no small effort to set that up, but once i had the basic setup i reused the code; i didn't use the blog module, since i predicted that they would actually never use it, and i didn't have time at that phase to integrate a module, i just did it quick with pages and page selects..
-
aw shucks folks, thanks for the writeup and SOTW ... ! now if i could just get that client to write some blog posts (finding that a lot of clients are insisting on blogs and never using them at all)
-
@Peter AFAIK if they are hidden then they shouldn't show up in searches to not index an internal link, add rel='nofollow' to any links to hidden pages, or add the noindex meta tag; also make sure you don't have a sitemap listing those hidden pages if there is no link to a page somewhere on your site then it shouldn't get indexed, unless i'm missing something
-
Pagination issue with three different queries on one template
Macrura replied to a-ok's topic in General Support
well you have some fairly nested stuff going on in there, it's tough to read/parse; i think what you'd need to do is setup your standard pagination and give it the necessary details... you may need to remove the first 7 items from this page array and do what you want with those, so that the start is with post 7 this is just a generic snippet showing what i usually do on paginated pages... nothing specific to your question /* GET ITEMS -------------------------------------*/ $items = $page->children($selector)->sort('-date'); //$items_per_page = 8; $items_per_page = isset($items_per_page) ? $items_per_page : 8; $start = ($input->pageNum - 1) * $items_per_page; $total = count($items); $items = $items->slice($start, $items_per_page); // make this to give MarkupPagerNav what it needs $a = new PageArray(); // add in some generic placeholder pages foreach($items as $unused) $a->add(new Page()); // tell the PageArray some details it needs for pagination // (something that PW usually does internally, for pages it loads) $a->setTotal($total); $a->setLimit($items_per_page); $a->setStart($start); $totalPages = ceil($total / $items_per_page); -
sure, you could have a hook on page save ready, which checks to see if page has an order number and if not it gets the order with the highest number and adds 1, and then sets the field value
-
wow thanks for looking into that, i may need to upgrade the jQuery plugin (https://github.com/galambalazs/smoothscroll-for-websites); it's a cool plugin
-
ok - thanks again for reporting; not sure what the issue is but it is probably related to the wow animate or the smoothscroll; i do see that the scrolling is faster on that page when i put it side bu side with this window....
-
@Marco - i believe that MarkupRSSEnhanced module does multiple feeds; i do something like this on my template where i need the feed: /* FEED GLOBAL SETTINGS -------------------------------------*/ $rssTitle = isset($rss_title) ? $rss_title : '9th Planet Blog'; $rssDesc = isset($rss_description) ? $rss_description : 'Official blog of the 9th Planet'; $limit = isset($rss_limit) ? $rss_limit : 10; /* RSS -------------------------------------*/ if($input->urlSegment1 == 'rss.xml') { $rss = $modules->get("MarkupRSSEnhanced"); $rss->title = $rssTitle; $rss->description = $rssDesc; $rss->itemDescriptionField = 'summary'; $items = $page->children("limit={$limit}, sort=-date"); $rss->render($items); exit(); } you can also roll your own feed by using like an atom class: /* ATOM -------------------------------------*/ if($input->urlSegment1 == 'atom.xml') { include("./classes/atom1.class.php"); $atom = new atom1( $rssTitle, $page->httpUrl . 'atom.xml', $default_author, $page->httpUrl . 'atom.xml' ); $posts = $page->children("limit={$limit}"); foreach($posts as $post) { $atom->addEntry( $post->title, $post->httpUrl, $post->wordLimiter('body', 400), $post->getUnformatted('date'), $post->id ); } header( 'Content-Type: text/xml' ); print $atom->saveXML(); exit(); } i'm using a slightly modified atom class from PHP Cookbook, so i can't post it here, but it's a very simple class which extends DOMDocument...
-
@teppo - thanks (as always) for checking these out! On a mac, FF,Chrome, the scrolling seems to be ok..i tried it on a kensington roller mouse and an apple touchpad.. OK - thanks for pointing that out , just fixed it (and a few other things as well while i was in there... site was launched back in October, but i don't think it has seen much traffic)... @bernhard - thanks for checking these out - hoping to post some mini case studies about some things that were developed for these, mostly to do with the blog.. @martijn - thanks - couldn't have done these without your modules!, especially AdminCustomFiles! i think almost all of these use the image tagging setup from this past summer
-
some recently launched pw-powered sites... Roger Shapiro Fund for New Music Custom blog & news, projects listing and works w/ dataTables... using Soma's social share for the sharing buttons http://www.rogershapirofund.org/ Daniel Lippel, Guitarist http://danlippel.com/ Flowers by Selina Website for floral designer in Westchester, NY. Features custom blog, homepage featured portfolio and full masonry portfolio. http://www.flowersbyselina.com/ Eric Huebner, Pianist media handled by Soundmanager2. A frontpage ajax-powered widget was implemented to let visitors browse the concert & event calendar, with a browsable month view. http://www.erichuebner.com/ Anderson Chase Gallery Simple one-pager http://andersonchasegallery.com/
- 13 replies
-
- 19
-
Previous & Next navigation links in page editor?
Macrura replied to hellomoto's topic in API & Templates
yeah, turned out i needed the same thing, so there is this now: https://processwire.com/talk/topic/11932-prevnexttabs/ -
i would just use fields for your fields; there are fields for all of these: date: datetime description: textarea priority: options persons - page multi select progress - options/select or radios, or slider, or pages/radios for the frontend, you use dataTables to list your items; the filters are simple and done with javascript; a lot of examples on dataTables website
-
you could build your selector with some variables/arrays then you could set those in your init and be able to use them in multiple places,... $excludeArr = array( "template!=home", "template!=basic-page" ); $exsel = implode(',', $excludeArr); $pages->find($exclude);
-
The dashboard module itself does a redirect, but it looks for the first child of the admin page: if ($this->page->id == 2) { $this->session->redirect($this->page->child->url); } using the method described in the first post gives you more control if you want to keep everything in your templates folder and do the redirect within ready.php; the dashboard module changes process on the admin page which may not be wanted; also if you do end up using the dashboard module, it may be prudent to rename the module so that any customizations or additions are not overridden in case of a module update.
-
the latest screenshot i use pages for the shortcut widgets as follows; this is a basic setup and will be expanded upon gradually: the widgets are pages this is the template for making shortcuts; the shortcuts are configured first, and then added to the widget; this way shortcuts can be used in any widget this is the page for configuring a shortcut widget this is the shortcut page showing the page select for the shortcuts there is one template file dashboard.php which controls the contents of the dashboard. the shortcut widgets are generated automatically based on being setup in the admin; the lister widgets are currently hardcoded but the plan is to make them configurable using a selector field
-
can you try moving the page up to the top, in the admin page branch? sure, i can try, and the plan is to eventually make a module... but in the meantime i'll try and make a tutorial, because until the module is made, it's just a lot of fields, templates and pages in the admin; then 1 dashboard.php, and 3 css files
-
Do you mean which PW theme, or which theme is used in the dashboard area (which uses a mini admin theme style-scoped into the dashboard container)
-
@Pete - i'm wondering how to 'addon' to this module in the sense that your module provides a blank canvas for setting up a dashboard, but i'd like to avoid changing anything in your module and also avoid putting anything custom into the module folder; what i did to hack this was change the dashboard module like this: public function execute() { // Redirect calls for the admin homepage to the dashboard (first child page) if ($this->page->id == 2) { $this->session->redirect($this->page->child->url); } $dashboard = $this->getDashboard(); return $dashboard->render(); } public function ___getDashboard() { $t = new TemplateFile($this->config->paths->siteModules . __CLASS__ . "/dashboard.php"); return $t; } then in my dashboard widgets module, i have this: public function init() { $this->addHookAfter('ProcessDashboard::getDashboard', $this, 'getCustomDashboard'); } public function getCustomDashboard(HookEvent $event) { $template = $event->return; $event->replace = true; $template = new TemplateFile($this->config->paths->siteModules . __CLASS__ . "/dashboard.php"); $event->return = $template; } let me know what you think, if this would be a possible change that wouldn't affect existing sites, but would allow other modules to hook into the main dashboard for rendering...
-
@Pete - thanks for noticing.. yeah there isn't really a 'blog' icon in fontawesome, so i just used that one..., and i also have some questions/comments about the dashboard module, but i'll do those over on the module thread.. @Mike - yeah, i should probably change to a rocket, but the idea of 're-routing' something seemed also to communicate what that does... any sort of looped arrow i guess would work...
-
Update: So I've been using Pete's dashboard module instead of the technique described above; it's quicker to setup, and easier to clone to other installs, and no need to have code in various places like the themes folder and in ready.php The hope/plan is to turn it into a full widget enabled dashboard module that i can install on various installations a) without having to do any hardcoding b) enable control over which widgets are shown on the dashboard (by user/role/permission) c) allow for easy configuration of colors, icons, columns, etc. To achieve this I setup some templates for different widget types, one is a shortcuts widget, another is a page lister widget; these each have pages and fields to configure them; i can set them to appear by user/role. in the future i can add different types of widgets as needed and then include them in the needed user's dashboard. This is using a combination of a free (MIT licensed) admin theme for bootstrap, but instead of using bootstrap as the css layout, it uses a tiny grid called rwdgrid which i s 2KB; it uses the box, and other widget classes from the admin theme.
-
yes, as mentioned you could use whatever you have in your kit and prefer to use, table, pagetable, repeaters, pages... though you may want to give Menu Builder a try...
-
Make dashboard plugin page the default admin page
Macrura replied to kriegar's topic in General Support
Also, the module itself should handle the redirect: // Redirect calls for the admin homepage to the dashboard (first child page) if ($this->page->id == 2) { $this->session->redirect($this->page->child->url); } i usually just move the dashboard page up to the top if it isn't there after installing. you could also try posting your issue on the module's topic. -
can you check the error logs and see if there are any errors? When you say you added some pages to a page, do you mean a page table field? I'll also include the boilerplate troubleshooting below... ----- In order to provide the best chance of help, could you provide the following info: Processwire Version Apache, MySQL & PHP Versions List of installed modules details of any applicable/related errors in your error log (assets/logs/errors.txt) Browser you are using In addition make sure to take the following steps before reporting errors: Upgrade to the latest stable version of PW Upgrade all modules to the current version Install the diagnostics module check that your server environment meets the minimum server requirements Repair database tables address any existing warnings or failures Try increasing your .ini variables like memory, and execution time *Note, if you cannot even run processwire due to WSOD or other fatal error, please try a clean install, and then import the site folder and database, prior to posting issue reports. When reporting errors that happen on a form such as the editor, please open the chrome console, or FF/firebug, and see if there are any network or JavaScript errors. Please report those errors along with your issue.
-
PrevNextTabs Module Github: https://github.com/outflux3/PrevNextTabs Processwire helper modules for adding page navigation within the editor. Overview This is a very simple module that adds Previous and Next links inline with the tabs on the page editor. Hovering over the tab shows the title of the previous or next page (using the admin's built in jqueryUI tooltips.) Usage This module is typically used during development where you or your editors need to traverse through pages for the purpose of proofing, flagging and/or commenting. Rather than returning to the page tree or lister, they can navigate with these links. Warnings If you are using PW version 2.6.1 or later, the system will prevent you from leaving the page if you have unsaved edits. For earlier versions, to avoid accidentally losing changes made to a page that might occur if a user accidentally clicks on one of these, make sure to have the Form Save Reminder module installed. http://modules.processwire.com/modules/prev-next-tabs/
- 29 replies
-
- 21