Jump to content

kongondo

PW-Moderators
  • Posts

    7,529
  • Joined

  • Last visited

  • Days Won

    161

Everything posted by kongondo

  1. Blog 2 is now on dev branch of the project page on GitHub. I have edited post #123 and #124 with links to this effect. Version 2.0.1 is coming out soon. I picked up on some broken Markup bugs whilst testing the other day as well as some output redundancy...
  2. @Bernard, Thanks for wanting to test. If you are using ProcessWire 2.4 (I think) and above, you can update modules from within admin. If you upload a module that already exists, ProcessWire will automatically upgrade the existing one with the uploaded one. Until Blog version 2 is available in the modules directory, you now have two options of updating from version 1 to 2. Method 1 Download the above Blog 2 zip package to your computer. Go to ProcessWire modules screen, click the tab New and scroll down install module via upload (or something to that effect - I am writing this from memory). Upload the zip file you downloaded in #1. ProcessWire will do its magic. Follow the rest of the instructions in post #124 above about updating. Method 2 Go to ProcessWire modules screen, click the New tab and scroll down to install module via URL (or something to that affect). Enter the URL of the dev branch of the Blog project website - link. ProcessWire will update the Blog module. Follow the rest of the instructions in post #124 above about updating. That's it
  3. https://processwire.com/talk/topic/3579-tutorial-approaches-to-categorising-site-content/
  4. Updating Blog version 1 to Blog version 2 Note: some paths have changed. You will have to update such paths in your template files. Please see point #10 below 1. Log in as a superuser. 2. Backup your site! (For good measure). 3. Update Blog version 1 to version 2. Grab version 2 in the previous post OR from Blog's dev branch in GitHub 4. Paste the contents of the attached update script (blog-upgrade-version-1-to-2.txt) at the very top of one of your site’s template files. This script will create a ‘settings’ page under ‘blog’. The fields in the pages ‘blog’ and ‘posts’ will now reside in this new settings page. Their existing data will be copied over to the settings page. There will be no data loss. In addition, one extra field called blog_small will be created and added to the settings page If you want to enable the Auto-publish/unpublish feature FIRST install the module SchedulePages. Second, uncomment line #41 in the update script AND comment out line #40 of the script before copying and pasting. Save the template file. 5. View a page that uses the template associated with the template file in #4. 6. A success message will be displayed if all went OK. 7. Undo the changes to the template file in #4. Save. 8. Go back to your site’s admin to confirm things went fine, in particular: Check that a ‘settings’ page was created under ‘blog’ View ProcessBlog’s module configuration settings page (admin > modules > blog) by clicking on its settings button. You should see a message about Blog already fully installed Visit Blog Dashboard to confirm things went OK. If you enabled the Auto-publish/unpublish feature above, you should see two extra date fields in the Quick post dashboard (‘Publish from’ and ‘Publish until’). Similarly, edit one of your Blog’s posts pages. You should see these two date fields as well at the very top of the page. 9. Manually remove the now redundant fields in the templates ‘blog’ and ‘blog-posts’. Template 'blog': fields to remove: Blog Title - 'blog_headline' Blog Tagline - 'blog_summary' Footer - 'blog_note' Quantity of posts to show on blog homepage - 'blog_quantity' Template 'blog-posts': fields to remove: Posts truncate length - 'blog_quantity'. This will now become blog_small in settings page 10. Edit your template files paths that pointed to these fields you’ve just removed to now point to their counterparts in the settings page, e.g. $pages->get('/blog/settings/')->blog_quantity; That's it. You are updated. If you want to, you can now even rename your Blog pages to whatever you want (within reason of course ).... Enjoy! blog-upgrade-version-1-to-2.txt
  5. Blog version 2 Introducing Blog version 2! There are lots of changes so this will be a long read. For upgrading from version 1 to this version, please read the next post. I’ll appreciate beta testers. As you’ll see below, there’s lots of new things (and combination of things!) to test. Many thanks! TL:DR: Blog version 2 is available for beta testing. It comes with a two-step installer that allows you to structure where your Blog lives in your page tree just the way you want and cleans-up after itself in case it isn’t your cup of tea. Please see next post about updating version 1 to 2. Main Changes 1. Configurable Blog 2 is a now configurable module (i.e. ProcessBlog). On a fresh install, you will first have to set a couple of settings before you can run the module. More on this below. 2. Installer Blog 2 comes with a two-step installer. No more installing things you don’t want. In the first step, you set the module configurations in the module settings page as mentioned in #1. The configurable settings are outlined later below. In the second step, via the Blog dashboard, you will see an overview of the settings you selected in the first step above. Here you finalise Blog’s installation. Before you click the button to run the install wizard, nothing will happen yet. You can still go back and change the module configuration settings. Until you run the install wizard in this second step, you will have no Blog pages, fields, templates, etc. On this page, you will also be able to rename your Blog’s main pages before they are created. Yes! If you don’t do it at this stage, you can also rename them post-install in the ProcessWire tree! If you are happy with your settings, click the install wizard to proceed. Blog will be fully installed with your settings before you can dash out to make a coffee . You will then see the familiar Blog dashboard Please note: If you need to change some configurations, you can go back to the module settings and do it BEFORE you finalise step two of the installation. It is important that once the installation is finalised, in case you had left the ProcessBlog's module configuration's browser window open, NOT to press submit again. Otherwise, MarkupBlog may not like it . However, if you reload the module configurations screen once the second-part of the installer has finished, you will not be able to change the configuration settings. Instead, you will be presented with an overview of your installed settings. 3. Blog styles Blog now allows you to install your Blog pages from a choice of 4 different URL structures, aka Blog styles! These should cover most (all?) needs. This means that your Blog pages will live exactly where you want them in the tree, hence give you the URL you want. You select the style you want in ProcessBlog’s module configuration screen (first step of the installer). A visual of the 4 styles is presented on that screen. Example paths for the 4 styles are: Blog style 1: /mysite/blog/posts/example-post/ (similar to Blog version 1) Blog style 2: /mysite/blog/example-post/ (as requested by FuturShoc) Blog style 3: /mysite/posts/example-post/ (same as Ryan’s Blog profile) Blog style 4: /mysite/example-post/ (as requested by PWired) 4. Commenting feature In the first step of the installer (module's configuration's screen), you can choose to install commenting feature or not. The default is to install commenting feature. If you elect not to install this feature, Blog will not install any comments-related components – so no comment fields, associated pages, templates and template files! Note, you CANNOT add this setting once Blog install has been finalised. 5. Auto-publish/unpublish This much requested feature has now arrived! You choose whether to install this feature or not via ProcessBlog’s module configuration screen. The default is auto-publish/unpublish is not enabled. If you want to use this feature, you will FIRST have to install the great SchedulePages module. If you have the module installed, this will be specified in Blog’s module configuration screen. Again you will not be able to proceed with installing this feature unless SchedulePages is installed. If you install this feature, you will see two date fields when editing a blog post, i.e. ‘Auto-publish from’ and ‘Auto-unpublish on’. You will also see these two date fields in Blog’s Quick post’s dashboard. Note, you CANNOT add this setting once Blog install has been finalised. 6. Templates Blog will install templates according to the Blog style you have selected. So, if you went with style #4, you will not have a template called ‘blog’ nor one called ‘blog-posts’. 7. Template files In the first step of the installer (module configurations screen – I know, I am repeating myself!), you have three options when it comes to template files when installing Blog. The default is to install blank template files (with nothing but php tags – a little something to help you get started quickly). The second option is to install demo blog template files (more on this later) and the third is not to install any template files. 8. Demo template files These files have now been streamlined. No more verbose code! A blog-main.inc contains most of the markup and the other template files contain most of the code. The demo will work with any of the 4 Blog styles. 9. Cleanup One of the annoying things with Blog version 1 was not only that it installed things you probably did not need, it also left behind, uh, leftovers (templates, role, pages, fields, template files). Well, no more! Uninstalling Blog is now a two-step process. If you are logged in as a superuser, you will see a Blog menu item called ‘Cleanup’. It will lead to a screen with info about all the fields, templates, pages and role you are about to delete. It will also list the Blog template files that, if you wish, you can also delete. This utility is also useful when you want to try out the different Blog styles without uninstalling the whole Blog module. It returns Blog to the state similar to when you first installed the module. Of course, in case you want to remove Blog as well, just go ahead and uninstall in the normal way but AFTER you have cleaned-up . 10. Renaming Blog pages As mentioned previously, you can rename any of your Blog pages pre- or post-install. Want Diary or Journal instead of Blog? Sure, go ahead. Want Writers instead of Authors? What about Chronicles in lieu of Archives? You can have those too. The only things you should NOT do are to delete the main Blog pages (i.e. anything other than Example Tag, Example Category and Example Post) OR (however remote the chance of this is) CHANGE the IDs of these pages (in the database). In order to allow for flexibility, Blog stores and tracks its main pages using their IDs. 11. Fields and templates admin tag In step 1 of the installer you can choose to change the default name of the tag used to group Blog fields and templates in the admin. You can as well choose not to have any tag and let anarchy reign in your admin pages! 12. Context aware Most of the Blog dashboard is now context aware. It will only display info about Blog components that are installed. No comments? Fine, no comments in Posts dashboard, etc. Apart from ‘Posts’ dashboard, the other Blog dashboards will be labelled according to the titles of your main Blog pages. For instance, if you called ‘Categories’ ‘Classifications’, that is the name you will see in the ‘Categories’ dashboard label. Same for Authors, Tags, etc. Even Cleanup is context aware and will only list components related to the Blog style you installed. OK, so how do I get Blog 2? You can install via ProcessWire modules screen. get it on the dev branch of Blog in GitHub. It is also attached below (please use Github - it is the latest version). I thoroughly tested this but I probably missed something or mixed up my code somewhere so there could be bugs . Please help me find and swat them, thanks! Next post, updating Blog 1 to 2.
  6. Various ways to do this, probably easiest is Adrian's Migrator: https://processwire.com/talk/topic/4420-migrator/ https://github.com/adrianbj/ProcessMigrator
  7. @Diogo - cool idea using lightning.pw...I always forget that. But where is your demo?
  8. Of course Diogo forgot to mention you sanitize the user input first .... $pid = (int) $g $p = $pages->get($pid) Seen this? http://processwire.com/api/arrays/
  9. Hi Bernard. Welcome to ProcessWire and the forums . Thanks for testing Blog...I hope you have also had a chance to follow some PW tutorials and read through API docs. Blog will make much more sense once you've done that The answer to your question lies right in the renderPosts() tutorial, specifically about the first argument the method accepts. As stated in the tut, that can either be a string, a Page or a PageArray. In the example below, we pass the method a 'Page'. We look for all posts under the category 'Fanions' (a Page). You could as well have used a selector string. $blog = $modules->get('MarkupBlog'); $category = $pages->get(1234);//This is ID of category'Fanions'. Can also get by other selector, e.g. name, title, etc. $posts = $pages->find("template=blog-post, blog_categories=$category, limit=5"); echo $blog->renderPosts($posts); This code will only return posts under category 'Fanion'.
  10. Welcome to PW and the forums Douglas! That's a beautiful site. Good job on the conversation and thanks for sharing
  11. @Lars - If you use the full editor to edit your first post you can modify your own title
  12. The only search engine for this forum you' ll ever need
  13. Not an answer to your question but curious why you are doing it this way (manually changing parent)...This sounds like a 'featured page' scenario. Why not use a checkbox instead? Or a page field?
  14. The shiny new ProcessWire 2.5 features were just too bright for my eyes....oh wait, it's sunglasses I need..........
  15. public static function getDefaultData() { return array( 'total' => 0, 'limit' => 10, 'anotherDefault' => 'blah blah', ); } public function ___install() { //do stuff here, etc., etc. //save default module configurations on install wire('modules')->saveModuleConfigData($this, self::getDefaultData()); }
  16. Lol!
  17. @Ottogal, in this particular case, Ryan upgraded with a version that matched his current version
  18. I really need to code faster! Hehe...This was on my todo list! Saves me some time to do other stuff now (remember my recent GitHub question? ). Looking really good Ryan!
  19. You want to Google 'Responsive Web Design' ProcessWire is up to any task ...but it has nothing to do with output. It will output whatever you throw at it so.... But here's a great classic if you've not seen it before: http://alistapart.com/article/responsive-web-design
  20. Andrei, Sorry about your troubles. Did you read this troubleshooting guide by any chance? If not, please do. Internal Server Errors are almost certainly htaccess issue. Also, have you tried upgrading from PHP 5.2.17 to 5.3.8 or newer as stipulated in PW requirements? Edit: Martijn was faster
  21. ChiefPundit, welcome to PW forums! Cool first post! Thanks for writing the case study. Greate write-up! That's a really beautiful site you got there! Maybe add a link to your site in your OP, thanks.
  22. This sounds like a good case study for PW...if you could do a write-up about creating a social network site with PW that would be great . Btw, when ready to migrate to 2.5, are you saying you couldn't even warn users in advance that the site will be offline for a set number of hours?
  23. Is it because you are echoing $out in your docsListSidebar() and eventsListSidebar() functions instead of returning $out? Just guessing; only had a quick look..
  24. If checking physically in GitHub, look in the file /wire/core/ProcessWire.php on this line and the next two. Not sure if it is in other places too...
  25. And it was tweeted by Antti too: https://twitter.com/apeisa/status/471679739162546177
×
×
  • Create New...