Jump to content

kongondo

PW-Moderators
  • Posts

    7,529
  • Joined

  • Last visited

  • Days Won

    160

Everything posted by kongondo

  1. You need to get in in context $p = $pages->get(1040); $label = $p->fields->get('body', true); echo $label; // or if you are sure the page is there, a one-liner echo $pages->get(1040)->fields->get('body', true); Edit: I could have sworn @LostKobrakai was asleep . Beaten, again
  2. Update: Version 6 (on dev branch only for now) Changes Thanks to @BitPoet, on a paginated coordinates' table, clicking on a marker will, where necessary, bring its page into view --------------------------------- @BitPoet, thanks! Following your ideas, I did it like this: Server-side, add a data-row='n' to each marker specifying its row in the coordinates' table (same number you see on the markers ) In the pagination function (js) for each page, get the number of the first row and add that to a data-first-row='n' attribute for each respective span Created a function that, on clicking a marker, it finds the first span (#2 above) whose data-fist-row is greater than the marker's data-row. If found, our marker's page is the immediate previous page, so we click on that if it's not already in view (!class='active'). If span 'is out of bounds', it means we are on the last page so we click on that instead. If selector returned nothing, it means there's no pagination in place, so we do nothing. Demo
  3. Sourcetree (and I believe other clients) handle the folders for the branches for you behind the scenes. Using Sourcetree I have only 1 main project folder per project (with sub-folders and files inside, of course). I start off with a master branch which I then clone to become a 'dev' branch. My dev branch then becomes my 'working' branch. Every time I edit my files, I am working on the dev branch. When I am ready to share the code, I push the dev branch to 'origin' which in many cases is GitHub (but can be BitBucket as well). Sourcetree will ask which branches in the origin I am pushing to. I push local 'dev' to origin (i.e. remote) dev. When the code is stable enough, I merge dev to master. If I switch to master as the working branch, and edit my files, Sourcetree makes sure that my text editor is editing master files and not dev. So, it is important to ensure you have the correct branch set as the working branch. Earlier in the days I used to have separate folders for master and dev branches and it was just too tedious... I suggest you Google some intro to GitHub or Git. There's some nice resources out there Edit: Check out your repository settings RE linking your local and remote branches..
  4. I use source tree for all things GitHub...https://www.sourcetreeapp.com/
  5. Update: Version 5 (dev branch only) Changes Added pagination to coordinates' table (adaptation of this easy table pagination script) [@note: (i) selecting trash all will trash all rows whether in view or not: (ii) *clicking on a marker whose table 'page' is not in view will not bring that page into view. I need help with this] If using AsmSelect, made it so that selectable pages that are already markers (i.e. already in the coordinates' table) are greyed out and are un-selectable (similar to normal page field behaviour) [@note: the JS I am using may not work in some (older) broswers] * need help with this please, thanks. I've noticed that IE does not seem to understand element width() [only innerWidth()]. This results in very massing coordinates' values. I'll see if I'll sniff user agent to accommodate IE. My policy in respect to free modules is I don't bother with IE ) Screenshot
  6. Everything you need is in that example ...Constructing the menu manually is also a good option where there are only few items and the menu will not be changing
  7. Hi @bluellyr, Welcome to PW and the forums. Currently it's not possible but its something I think I can easily add to the module (no ETA though!). Meanwhile, you can try what @Webrocker did here or check if MarkupSimpleNavigation (a non-GUI menu builder) will enable what you are after.
  8. For the sake of people searching for modules, you might want to consider renaming the module. I doubt somebody would search for 'Happy' ...; not very descriptive for a module....Just a thought...
  9. Is the name of the module HappyClasses or DynamicCSSClasses? Congrats on your first module.
  10. Maybe abstract different tasks to different (sub)modules? Something similar to the tools module by netCarver et al. (can't remember its name atm). Then one could add only the bits they need or use other third party tools for some tasks. As for the monitoring system itself, I would probably install it on a ProcessWire site with no frontend traffic, basically, only backend whose only work is to monitor, inform and issue commands to the sites being monitored. Oh, welcome to PW and the forums petejones
  11. OK, thanks. I'll let it marinate a bit more then merge to master, probably next week.
  12. Looks like you are in a template file rather than a module. In that case, PHP does not know what $this is. Turn debug mode on to catch such errors...Change code as follows: $session->CSRF->getTokenName(); $session->CSRF->getTokenValue(); Edit: ..and you also need to echo out your token name and values
  13. There's an example here as well: https://processwire.com/talk/topic/6562-sending-email-after-moving-page-from-one-parent-to-another/?p=64588
  14. I'm glad you find the module useful
  15. Yes...there's the (commercial) module Padloper... You would have to do some work to get your shop to look just the way you want but Padloper comes with very good documentation Welcome to the forums
  16. I think what you are looking for are chained/dynamic/dependant selects. ...http://www.appelsiini.net/2010/jquery-chained-selects There's been some talk before in the forums, e.g. this one: https://processwire.com/talk/topic/8729-how-to-create-a-form-with-dynamic-select-list-filtering-available-values-by-multiple-fields/
  17. Have you seen this as well? https://processwire.com/talk/topic/4451-menu-builder/?p=95415. For such sites, you can also pass the $page object or an array of menu items. This is also mentioned in the readme PS: Moving this topic to MB support forum...
  18. @adrianmak Currently that's not supported. I might consider it in future versions, depending on demand.
  19. That code won't work... First, grab some pages, then check if they are selected in the current (or some other) page's pagefield: $pagesPotentiallySelectedInNameOfYourPageField = $pages->find('template=products, limit=50'); $someOtherPageWithNameOfYourPageField = $pages->get(1234); foreach ($pagesPotentiallySelectedInSomePageField as $p) { if($page->name_of_your_page_field->has($p)) echo 'yes, am right here, wohoo!<br>'; //if($someOtherPageWithNameOfYourPageField->name_of_your_page_field->has($p)) echo 'yes, am right here, wohoo!<br>'; else echo 'not in here!<br>'; } http://cheatsheet.processwire.com/?filter=has
  20. if($page->your_page_field->has($p));// // if that doesn't work. if($page->your_page_field->has($p->id)); Typing from memory so there could be errors..
  21. Yeah, confirm what @adrian said first.....
  22. Hi @Snd, Welcome to PW and the forums. Can you confirm you have install.php on your server? (assuming you FTP'ed new files for a new installation)...Otherwise, what @rick said... Edit: Beaten be @rick
  23. Thanks for testing. Please look out for any PHP errors (debug needs to be on => but not if you are testing on a live site ), thanks.
  24. Hi @Asmordean, Welcome to the forums. Until yesterday, not it was not possible. Given your question (and previous requests), I have gone ahead and added an option to enable CKEditor in Quick Post (see demo below). This is currently in the dev branch only (version 2.3.6). To enable, follow these steps: Update Blog to version 2.3.6 from Dev branch (either download the zip or use url to pass to PW to upgrade the module) Scroll to the bottom of ProcessBlog's module configurations (via /modules/). Check the box to enable use of RTE in Quick Post. NOTE: This setting (unlike the others) is available both before and after installing Blog). I decided to keep it here so that only Superusers can control it Head over to /blog/posts/ and reload the page. You should see CKEditor loaded Note: If you are on an older ProcessWire install without CKEditor, you will not see the RTE, of course. You cannot insert images in your post using this option. To do that, edit your post in normal 'page-edit' mode Please test and let me know how it goes.
  25. Why not? If those 1st and 3rd links need to be grabbed only once, then first grab them using normal PW API, outside the foreach. Use a counter with your loop: $myFirstLink = 'http://www.google.com';// however you got it $myThirdLink = 'http://www.bbc.co.uk';// however you got it $out = ''; $i = 1; foreach($page->selectHeader->pageSidebar as $sideNav) { if($i == 1) $out .= "<li><a href={$myFirstLink}>{$whateveYouWantHere}</a></li>"; if($i == 2) $out .= "<li><a href={$myThirdLink}>{$whateveYouWantHere}</a></li>"; $out .= "<li><a href='{$sideNav->sidebarURL}'' >$sideNav->sidebarTitle </a></li>"; $i++; } echo $out;
×
×
  • Create New...