Jump to content

Macrura

PW-Moderators
  • Posts

    2,776
  • Joined

  • Last visited

  • Days Won

    40

Everything posted by Macrura

  1. i don't have a file for my settings page, and it works because of the code you put into ready.php in terms of the icon, if you are on Reno you set the icon from the module settings to get your settings to the top menu, just move the admin page to the top of the list.
  2. what i've been trying out today is just doing it in javascript, using this: https://github.com/nwcell/ics.js/ because then whatever events are viewable in the dom can all be put into a one-click add to calendar on the fly I'm showing events list in a datatable) what i'll probably do is put each piece of the info into data attributes, like data-title, data-description, data-dtstart, data-dtend as a test i have this working: ('#download-ics').click(function(e) { var cal = ics(); e.preventDefault(); $("#events tbody tr").each(function(){ var title = $(this).find('h3').text(); var desc = $(this).find('h3').text(); var loc = $(this).find("dd.location").text(); var dtstart = $(this).find("dd.dates ul>li").text(); cal.addEvent(title, desc, loc, dtstart, dtstart); }); javascript:cal.download(); }); you could also have a single click id for the button next to any individual event and then not do the each
  3. just curious if anyone uses any part of that library... http://phpjs.org/ there are some nice little functions here and there you can include in your project and then use the familiar php function; http://phpjs.org/functions/ucfirst/ http://phpjs.org/functions/ucwords/ http://phpjs.org/functions/strtotime/
  4. hey thanks, yeah that was hastily written and untested/not debugged- i just changed the $page var to $event... wasn't sure about the $allowedSegs also; i usually do that in terms of when i'm expecting a small set of segments, like archive, tags, category, etc; in this case you have a larger pool of possible segments, but yeah the logic probably needs to be redone here so that you get the name first and then return the 404 later like you said...
  5. @gmclelland - it should be really simple to achieve an add to calendar, especially with processwire. 1.) check for url segment and if it is valid echo your ical, and exit... /* HANDLE SEGMENT AND ROUTING -------------------------------------*/ if($input->urlSegment2) throw new Wire404Exception(); if( strlen($input->urlSegment1) ) { $pageName = substr($input->urlSegment1,-4); $pageName = $sanitizer->pageName($pageName); $event = $pages->get("name=$pageName"); if($event->id) { header('Content-type: text/calendar; charset=utf-8'); header("Content-Disposition: inline; filename={$input->urlSegment1}"); $options = array( // associative array: // send vars to your vevent processor here... ); wireRenderFile('./inc/vevent.php', $options); exit(); } } } here is the alternate way if($input->urlSegment2) throw new Wire404Exception(); if($input->urlSegment1) { // if urlSegment1 render the single camp $pageName = substr($input->urlSegment1,-4); $pageName = $sanitizer->pageName($pageName); $event = $page->child("name=$pageName"); if($event != '') { header('Content-type: text/calendar; charset=utf-8'); header("Content-Disposition: inline; filename={$input->urlSegment1}"); $options = array( // associative array: // send vars to your vevent processor here... ); wireRenderFile('./inc/vevent.php', $options); exit(); } else { // if the event does not exist... throw new Wire404Exception(); } } you can generate the VEVENT using a class, function etc..
  6. @Erik Richter, I believe your best chance of obtaining a fix for this would be to open an issue on Github: https://github.com/conclurer/PageBookmarks/issues
  7. i would first try running the query once for each of the $parts, and then add the results to a final Pagearray()
  8. Macrura

    5 of a kind

    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..
  9. Macrura

    5 of a kind

    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)
  10. @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
  11. 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);
  12. 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
  13. Macrura

    5 of a kind

    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
  14. Macrura

    5 of a kind

    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....
  15. @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...
  16. Macrura

    5 of a kind

    @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
  17. Macrura

    5 of a kind

    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/
  18. maybe you need this? $table->setEncodeEntities(false);
  19. yeah, turned out i needed the same thing, so there is this now: https://processwire.com/talk/topic/11932-prevnexttabs/
  20. 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
  21. 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);
  22. 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.
  23. 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
  24. 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
  25. 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)
×
×
  • Create New...