Jump to content

kongondo

PW-Moderators
  • Posts

    7,479
  • Joined

  • Last visited

  • Days Won

    146

Everything posted by kongondo

  1. Soma, I'll post this in MM's thread. I'm experiencing strange behaviour. In version 1.0.7 I see not download button . In older installs, I see the download button. Btw, does MM allow you to switch themes on the fly? This is what this proof of concept allows you to do. It does not install the themes for you.
  2. Aah, no I didn't know that! I have just checked but and I can see the themes but nothing to click to install. I'll check MM's docs. What can't you follow? Btw, the above is just that...a proof of concept + to show the versatility of PW
  3. Here's a proof of concept PW Admin Theme Switcher (video and write-up). It shows how versatile PW is. Since everything in the PW tree is a page, including Admin this was easy to do. I think on the roadmap PW will eventually allow switching between Admin Themes? Anyway, here's how I did it (verbosity below is intentional ). This is not a module but can easily be converted into one. Currently, I don't plan to do so since I suspect it will be overtaken by events (roadmap). Instead, I used the excellent Admin Custom Pages (ACP) module. On load, PW will first check if there is an admin template at /site/templates-admin. If there is none, it will check in /wire/templates-admin/. The file it looks for first is /site/templates-admin/default.php 1. I copied the contents of /wire/templates-admin/ to /site-templates-admin/ 2. I modified the contents of default.php as shown below in order to use it as a controller file $theme = $pages->get(1424)->theme_selector;//id of admin theme switcher page (the child page) include($config->paths->adminTemplates . "{$theme->name}/default.php"); 3. In order to use ACP in PW 2.3, you have to create a parent and child page. The child page will be rendered in the Admin. 4. I created pages under Admin as follows: Admin Theme Switcher Admin Themes (id#1424) Default Teflon Moderna, etc. 5. Admin Theme Switcher has nothing of interest. It just enables me to render its child page in PW Admin. Admin Themes has a single Page Reference Field from which only its children can be selected. This field is called theme_selector. Its reference value is the ID of whatever child page of Admin Themes is selected. 6. Default, Teflon, etc., have various fields to hold data about the themes - author, version, description, screenshot, etc. I populated these as needed. 7. In the above code (#3), 2nd line, I am telling PW where the default.php is. I am appending the name of the selected child page of Admin Themes. Hence, if the current selected page is Minimalist Blue, its PW name, minimalist-blue is included as part of the path. This means I need to create a corresponding folder at that path. 8. I grabbed all my themes in their respective folders including all their files and copied them to /site/templates-admin/. This ensured that there would be no conflict having multiple themes in /site/templates-admin/ folder. I also copied the default PW theme with all its files into a folder called default. I ended up with a structure like this: /site/templates-admin/default/ /site/templates-admin/teflon/ /site/templates-admin/moderna/ /site/templates-admin/appy/ etc. 9. Of course since the themes were now in sub-folders, paths in their respective default.php would be wrong. I needed to change this, e.g. in /sites/templates-admin/teflon/default.php, I changed the paths as follows: $config->styles->append($config->urls->adminTemplates . "teflon/styles/ui.css?v=2"); $config->scripts->append($config->urls->adminTemplates . "teflon/scripts/inputfields.js"); $config->scripts->append($config->urls->adminTemplates . "teflon/scripts/main.js?v=2"); $config->styles->append($config->urls->adminTemplates . "teflon/styles/droppy.css") <?php include($config->paths->adminTemplates . "teflon/topnav.inc"); ?> 10. Now that all is set up, there's two ways to change the current Admin theme: a. The template file of Admin Themes has a foreach that loops through its child pages (the theme pages) and outputs the meta data in a I column Grid. Each item has a radio input field to select the theme. On save, jQuery Ajax sends the single value (ID of selected theme) to a simple processor file. The processor file updates the value of the single Page Reference Field (theme_selector) using PW API. Via JSON, the processor then tells jQuery if update was successful and page is reloaded. b. Alternatively, the theme can be changed by editing the Admin Themes page, selecting a child page (theme) using the single Page Reference Field (theme_selector) and saving. PW will auto-reload the page, applying the new theme. As you can see, there is no rocket science here.....just an amazing CMS
  4. Works fine if you use default Module manager (PW's). You can only install via TextformatterHannaCode actually. Summary says this "Also Installs - ProcessHannaCode". The install button for ProcessHannaCode is greyed out with the message "Requires - TextformatterHannaCode". ProcessHannaCode auto installs. Maybe something with ModulesManager? @Ryan: The TextformatterHannaCode and ProcessHannaCode have the same name - "Hanna Code" in PW module manager. This can be confusing (but not a big deal).
  5. Sweet! Thx for the tip.. Tested it and got something like parent_id=1007, sort=title, limit=12, status<1024 Btw, what is status<1024 ?
  6. To some extent but I think Hanna is easier to use (?). Plus clear separation between PHP, js and text...
  7. Congrats on the relaunch. I know you are still ironing out kinks....here's one more (see attachment). You get this massive white space on the masthead div (height 728px) when you first open an article. If you hit refresh, it reloads to the right size (83px). Edit: see post below...false alarm, move on please, nothing to see here Yes please, would like to hear more about how the WP content was transferred to PW, thanks.
  8. This new module, Hanna, should make people familiar with MODX happy
  9. Wow! Nice one; you've been busy! Yes, there have been two or three questions from MODx'ers in the forums about something like this - the ability to randomly, directly call snippets, chunks and TVs within the body field/area in TinyMCE. Previously they've been pointed to shortcodes and tag parser. Hanna is certainly more powerful and would solve this issue easily. I can't wait to see the creative ways people use this . Thx for the module!
  10. Not sure I follow. You mean using foundation in a site-profile?
  11. You can use PW $page->render() method to pull in the content of Home into the Root page. See cheat sheet and/or search forums for more. You could also just use normal PW variables to output certain fields from "Home" into the Root page. If you use render, you want to make sure the HTML in the Home page is minimal (render will pull in the whole markup so you may end up with duplicate body, head, etc. tags, i.e. Root's and Home's . As for SEO, I don't know what effect this would have, sorry.
  12. Fernando, Welcome to PW. In other words, that $s is a temporary variable created to hold information about all the pages found by this $pages->find("template=skyscraper"). In order to get the most out of PW, I recommend that you first learn some basic PHP. See this thread for suggestions about good PHP learning resources. Cheers
  13. How I understand it.... When user clicks on "Home" he should be redirected to "Root". I suggest to put the redirect in the Template for Home to redirect to Root. This means Home will still have unique "Home" url but redirection will happen. Or else, if you want Home to have Root's address in the menu itself, then you will need to use some if statement.... I hope I understood you
  14. Yes... http://processwire.com/talk/topic/683-page-content-within-another-page/
  15. If it is Multiple Page Reference you will need to do a foreach on it to grab the pages since that returns an array. You can then echo out the fields in those pages...
  16. What?!! I totally missed that. When did that get there?!! I told you it will be difficult to enforce...hehe. Maybe on both?
  17. Hmmm.. I am talking about a FAQ that is divided into different sections covering various things that come up often such as where is the admin page? Why can't I sort my pages in the tree? Can PW handle thousands of pages? etc, etc..Of course we cannot cover all scenarios.
  18. True but maybe something we can point everyone to to have a read...sort of "before posting, please read the FAQs first...your question may already have been answered" kinda thing. This is difficult to enforce though...
  19. It seems several themes have that mistake; Appy, Bootstrap, Ergo, Futura, Moderna. Must be a relic from some base template.
  20. Soma, The path is still wrong in the current version (http://mods.pw/p) line 103 in default.php has this.. <?php include($config->paths->templatesAdmin . "topnav.inc"); ?> instead of... <?php include($config->paths->adminTemplates . "topnav.inc"); ?> templatesAdmin is wrong
  21. Thx for the links Wanze. In my case, initially, I thought it was only in Modules that I'd use wire. I was working on a function last week and gotcha! out of scope bit me . I think as the forum grows, we'll need a FAQ board to point out such issues.
×
×
  • Create New...