Jump to content

Michael Murphy

Members
  • Posts

    141
  • Joined

  • Last visited

Everything posted by Michael Murphy

  1. Nice - this will be great way to show how the Processwire API works. It's kind of like firebug / web inspector for PW.
  2. Have you tried adding this to the "TinyMCE Advanced Configuration Options" - go to the field which has TinyMCE and look under the Input tab. If that does not work you can also add the paste text button quite easily - pastetext Also the paste word button - pasteword
  3. Thanks for the kind words and feedback. I have just tested with the latest dev version and that solves the jQuery conflicts. About changing the "add new page workflow", for now I would be more interested in just customising the text. Something like "You are about to add a new “template name”. [Thumbnail Screenshot of template or icon] More details (about this template) Cancel or change template (if possible)". Maybe this could also be expanded to include cases like what @apesia describes above so you could add specific rules. Need to think about that some more. Regarding the login module, I would like to hide a few things like the home link, and also be able to add some extra text like "need access or forgotten your password - please contact ……" Now I need to work out how to distribute the documentation / quick links part as an extra module. The module will be quite simple - it will insert a new page / template called "documentation" which will have a text area for quick links and the documentation. I've never created a module before, so any advice here is welcome. Here are the changes I made to some core files /wire/modules/Process/ProcessPageList/ProcessPageList.js added this to line 442 so I can change the icons in the tree to indicate pages with children if(child.numChildren > 0) { $numChildren.addClass('hasChildren'); $li.addClass('hasChildren'); } /wire/modules/Jquery/JqueryWireTabs/JqueryWireTabs.js changed line 26 so I could use the tab classes used in bootstrap var $tabList = $("<ul></ul>").addClass("WireTabs nav nav-tabs"); changed line 76 and 77 var $oldTab = $($tabList.find("a.on").removeClass("on").attr('href')).hide(); $($tabList.find("li.active").removeClass("active")); var $newTab = $($(this).addClass('on').attr('href')).show(); $(this).closest('li').addClass('active');
  4. Thanks again Soma. You are correct, it was a bit of code that was causing the slowdown - a selector + array manipulation that I was using to get the most popular features . Once I removed this bit of code it went from over 6 seconds to under 1. Just to compare with the module removed and using the code the db queries takes around 1.4 seconds. removing both the code and the module, the queries take 0.8 secs. It was probably a very inefficient bit of code anyways. Thanks for testing, it's good to know that this solution can scale up to that level I will send you a link to the development version - you might find it interesting as it's a playground finder for Zurich
  5. I’ve been working on a simple admin theme. I originally just wanted to add a simple dashboard area on the home page to display some quick links to key actions and documentation for clients, but I ended up doing a whole theme. The main focus of the theme is for the client / editor role, so it’s not been optimised for the developer usage yet. There are a few enhancements which are aimed at clients (opening previews in a new window, showing tree actions on hover). I have also tried to optimise it for mobile layout. You can see a preview on this video It’s using the Bootstrap framework and Open Sans font. The main issues I currently have are a conflict with the Bootstrap framework scripts and the older version of Jquery that ships with the PW admin. If I upgrade to Jquery 1.8.2 a lot of PW admin functionality breaks (sorting, ask select, modals). If I stick with the currently shipped version of jQuery 1.6, the bootstrap scripts do not work (drop downs, message alerts, mobile navigation). The other big issue, is I made a few simple hacks to some core js files (/wire/modules/Process/ProcessPageList/ProcessPageList.js, and /wire/modules/Jquery/JqueryWireTabs/JqueryWireTabs.js) - this was mainly to insert extra css classes here and there or to show if the tree has children. Is there a better way to do this? Other issues I am thinking about Is there a way to modify the “add new page” workflow? So when the user adds a new page, I’d like to change the default “You are adding a page using the …” message. Maybe this could be an additionally template field called “instructions” or “”details” ? It could be a used as a kind of “templates documentation”, which could be used to document the project for other devs and designers and for the clients / editors. How can you modify the login screen without overriding this file (/wire/modules/Process/ProcessLogin/ProcessLogin.module)? Also not to sure if having two save buttons is good for usability - maybe I will just have one in the header and make it fixed as you scroll.
  6. Thanks for the profile, I have learnt a lot from exploring it. Is there any reason why there is access permissions set on 5 of the templates? - category - categories - tags - post - widgets Also, I thought the "export profile" module ignored access permissions when creating a profile?
  7. In the TinyMCE area she would just have to select the text, click insert link and then paste in the email (with mailto: appended) mailto:info@provisionevents.nl
  8. or maybe I misunderstood your question. Have you tried making the textarea Inputfield type to use TinyMCE? Then they could add an email link themselves (but would have to remember to add the mailto: before)
  9. You could create the "contact" field as a type "email" - that will then make sure that the users adds a valid email. Then in your template you would need to do something like this : echo '<a href="mailto:'. $page->contact .'">Contact</a>';
  10. Hey Antti, I also agree with you about the boxy feel. I have just been playing with the repeater element and tried to reduce the boxyness and make it similar to Renos style. Here is a screenshot This is not fully tested and will probably break other stuff, but here is the css I used so far .Inputfields > .InputfieldRepeater > .ui-widget-content { padding: 0; border:none; } .Inputfields > .InputfieldRepeater > .ui-widget-content .Inputfields > .Inputfield > .ui-widget-content { padding: 5px; border-color: #e6e6e6; } /*add a dropshadow to the repeater inputfields */ .Inputfields > .InputfieldRepeater > .ui-widget-content .Inputfields > .Inputfield > .ui-widget-content .Inputfield { -webkit-box-shadow: 1px 4px 5px -3px rgba(0, 0, 0, .1); box-shadow: 1px 4px 5px -3px rgba(0, 0, 0, .1); } .ui-widget-content { border-color: #e6e6e6; } .Inputfields .ui-widget-header { border-bottom:none; border-color: #e6e6e6; background: #ffffff; } .InputfieldStateCollapsed .ui-widget-header { border: 1px solid #e6e6e6; } /*this is the repeater element handle, changing it to a solid color */ .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: none; background: #b3b3b3; }
  11. First of all, don't worry too much, you will normally find all the problems after launching Here are some of the things I try to do before launch : - Check the page titles and meta descriptions. Install the Google webmaster tools to get more useful advice on how to optimise the site for search engines https://www.google.c...ebmasters/tools - Create an xml site map and submit to Google (via Webmaster tools) and Bing (http://www.bing.com/toolbox/webmaster) - If this is the an update of an existing site, setup redirects for old pages to new pages - you can check what old links are currently indexed by Google and start with the top ones. The redirect plugin is great for managing this (http://modules.proce...cess-redirects/). - Check and update the 404 error page - Check that all your forms are working and being delivered to email recipients (not stuck in spam). - Change the admin url from /processwire/ to something more secure - Turn off any debug modes - Disable any test accounts and put an extra secure password on the master account. - Check what print layout looks like (or make print style sheet) - Browser testing - this is tough one to summarise - there are some sites that let you take screenshots, but the best way I have found is to have multiple virtual machines with IE7, IE8 and IE9 which can be used for more detailed testing and debugging. Then there is mobile device testing! - Check for broken links and correct redirects. http://validator.w3.org/checklink - Performance testing - you might want to check for any big performance issues. ySlow is a nice tool for checking and provides some good tips that might be useful for speeding up the site. Don't be too disheartened by the results, not even the big sites get top marks. http://developer.yahoo.com/yslow/ - Setup analytics to track usage - Google analytics - Setup monitoring so you know the site is up and running - I really like pingdom.com - https://www.pingdom.com/ - Backup the site files and database! Then I like to say a little website launch prayer… "dear internet gods, I know things will go wrong but please let the issues be small and easy to fix. amen."
  12. we can teach clients how to do things, but that does not really lead to a better system. I would prefer to see how the client uses the system and then adapt it to what best fits their workflow. If i notice they are using the hide page functionality often, then perhaps this would be better placed somewhere else. This is a pretty edge case scenario, so I may be wrong, but I’d like to test and see. I really think the most innovative area of CMS will be around improving the workflow and user experience for each client and specific project. This is something that PW already handles very well and I’d like to push it further.
  13. As mentioned in the readme, this module does not work too well when you have lots of pages. I have been testing on a site with quite a few pages - there are over 150 pages used for locations, and another 120 pages used for categories. The affect on performance is very noticeable. Even when using ids on pages and parents. I’ve been trying to work out how to change the module so that it ignores certain templates or pages from being translated? For example, I don’t really need to have the categories and location names translated. Do you think this might help with performance? Any tips on where to add the ignore selector? On a side note, while my preferred solution would be to have proper urls for each language, (it’s much better for users and looks nicer), from an SEO point of view it might not be as important as I first thought. According to this post on Googles webmaster blog, it seems like so long as you indicate the current language in the url (which is solved by appending the /de/ or /en/) then you should be ok. http://googlewebmast...l-websites.html
  14. thanks Soma, I had never used the advanced setting before (whole new world!). It kind of solves the problem - the Name field gets added to the top of the content tab above the Title (and open by default). It does not appear that you can change the field description or placement. I agree that changing urls is quite dangerous, but it's definitely something that editors should be more aware of when creating or changing content. I think this could be best solved with a simple module that displays the current url below the Title field. The next thing I want to move is the "hidden" status option, which is another thing clients frequently ask (how do i hide a page?).
  15. I think the name inputfield (used to generate page urls) is hidden away on the settings tab. The url is an important part of a website and I fear that most clients don’t ever see this, or forget about it when changing page titles. Is there a way to move the name inputfield to the main Content area? Maybe below the title field - something like this screenshot : Or alternatively, maybe the page name could be updated whenever the page title is changed (with an option to override)? I recently had to regenerate all the urls in my site for various reasons. It was quite simple with the api - this was the code that I used <?php $pagesToCheck = $pages->find("template=playground|category"); $count = 0; foreach ($pagesToCheck as $toCheck) { $oldName = $toCheck->name; //this creates the new url - use Sanitizer::translate if your titles have special characters $newName = $sanitizer->pageName($toCheck->title, Sanitizer::translate); if($oldName != $newName){ //print out the pages to be changed echo $toCheck->title .' : '. $oldName . ' > '. $newName; echo '<br />'; //replace the old url with the new one $toCheck->name = $newName; //save the page $toCheck->save(); $count ++; } } if($count == 0){ echo '<p>looks like all urls have been updated!</p>'; } ?>
  16. Thanks Soma, that was it! I enabled "Allow Page Numbers?" on the language gateway template and now it works.
  17. The template has "Allow Page Numbers?" enabled. I have tried it with all the different module options. And I have tested with "Page ID prefix" and "Parent ID prefix" enabled and disabled. I just setup another test site, completely from scratch. Latest PW, only the LanguageLocalizedURL.module installed, default template, and with the basic pagination example. It still does not work. If I uninstall the LanguageLocalizedURL module, the pagination works. This is the debug information for the page with pagination - https://gist.github.com/ccd6e536289e649c502a Hope that helps. I can also send you a site profile of my local test installation.
  18. Hi Soma, First of all, thanks for helping to build and support this module. This is my preferred way to build multilingual sites and I hope to use this module in a lot of projects. I am testing this module on two different installations. The first installation has just been upgraded from 2.2.0.1 to 2.2.9. It has quite a few modules installed. The second installation is a test site I am using to play with the module. I recently upgraded it from 2.2.6 to 2.2.9. It is a pretty clean install and only has one extra module installed - an AdminHotKeys plugin - not sure who developed that They both have the latest module LanguageLocalizedURL installed 0.1.0 Both are setup in the root folder. On my test installation I have just setup a very basic pagination example as shown here http://processwire.com/api/modules/markup-pager-nav/ $results = $pages->find("id>1, limit=10, sort=title"); echo $results->render(); and it also has the same issues. Let me know if you need further information.
  19. Hey landitus, I also have the same issue with pagination (no solution though!)
  20. I also ran into this problem today. There does not seem to be any way to access a file or image from the TinyMCE insert file / image dialog when using a repeater. The only way to get around this issue is to add a file or image field to the main page (outside of the repeater). I would say the expected behaviour would be to first look for file / image fields within the repeater, then look for files / images outside the repeater (the main page). I am not sure you would ever want to access files / images from another repeater row. Should we add this as an issue to Github?
  21. Hi Michael, I have not seen any fields like that, but as an alternative you could try using a "page" type field. It would create a new page for each tag, but has a nice friendly interface for the user to manage them. 1. Add a new page in your tree called "Tags Collection", and make it hidden. 2. Create a new field called Tags and make it a "page" type. 3. On the input field settings, make the "Parent of selectable page(s)" the Tags Collection page 4. For the "Input field type" try one of : Select Multiple, asmSelect or PageListSelectMultiple (I prefer the asmSelect) 5. Check the “Allow new pages to be created from field?” to allow the user to easily add new tags directly from the field
  22. thanks apesia, and as I have just learnt in another post, instead of using strtotime( ) you can use the PW function getUnformatted( ) so the example would be <?php echo strftime("%d %B %Y", $page->getUnformatted("news_date")); ?>
  23. Hi totoff, I have also had some issues with dates and formatting. The best solution I have found (especially when you a see a date returning the unix epoch of 1970) is to first convert the date using strtotime, then do the formatting. for example <?php echo strftime("%d %B %Y", strtotime($page->my_date_field)); ?> which should output 16 October 2012. After writing this and thinking, I have a feeling that user created date fields are having some extra formatting added by PW which confuses the extra formatting you are trying to make in the template (while the built-in "created" field is just returning a unix timestamp and works ok), so probably the best solution would be to try $page->getUnformatted('date_field') like SiNNuT suggested.
  24. Just to update on this issue, I tried on same host with setlocale (no language support installed) = same problem I tried it on another host (using setlocale and no language support installed) and it also outputs the dates in English. It’s definitely setting the correct locale, but the standard $page->date; field is always outputting in English and seems to ignore it. The only solution I could work out was to convert the date using strtotime and then format it like this <?php echo strftime("%d %B %Y", strtotime($page->news_date)); ?>
  25. Hi SiNNuT, Thanks for the suggestion. After looking at the output using system('locale -a) I tried setlocale(LC_ALL, array('de_DE','de_DE.iso88591','de_DE.iso885915@euro','de_DE.utf8','de_DE@euro')); but it still outputs English dates. This might be because I have installed the language support, so should probably try this on a fresh installation
×
×
  • Create New...