Jump to content

kongondo

PW-Moderators
  • Posts

    7,479
  • Joined

  • Last visited

  • Days Won

    146

Everything posted by kongondo

  1. MODX did teach me a lot too. With PW I have learnt even more and am steadily moving from designer to semi-developer if there's such a thing PW has encouraged (not forced) me to move in this direction and the journey so far has been thoroughly enjoyable. It's so refreshing to type code, throw in some logic here and there and to see the results displayed! Anyway, I digress. You've made the right choice to start using PW. Enjoy!
  2. I was just about to ask you about that. AFAIK, in PW parent IS NOT same as grandparent. For grandparent you can use has_parent property (http://processwire.com/api/selectors/). Currently, you can only specify one value for each declaration of has_parent in your selector, so you can do has_parent=5, has_parent=15 BUT CANNOT do has_parent=1|87|90. I think there is another approach to querying grandparent ancestry relationships as well; I can't recall it atm. Exclude a whole tree or a whole branch? Yes, you can do both...using ancestry and/or template association...
  3. I'm not suggesting that it won't work in current stable release (2.3); I just haven't tested in that environment (yet). Edit: Tested with current stable (non-dev) version (2.3). It works as expected; parent!=1020 excludes children of 1020 from Select selection in Page Reference Field (tested with single Page Ref Field) when logged in as non superuser. Meaning...that was not your issue...
  4. Thanks bcartier. Yes, I plan to have a filter (if this goes to production ) The filter would be trivial to implement I think - if not, I'll just pinch it off Wanze's Batcher
  5. Allan, If home page had no children your website would have only 1 page; home In PW, all pages are children of Home. So, home has children. This is even evident when looking at the site map page..."about", "site map" and "templates" are all children of home. I can see the same thing in your test page meaning you haven't changed much. Even if you had, yes, all those other pages (if you had them) would still be children of home Remember, the renderBodyNav($page->children) code is specific to the page being viewed. Page always refers to the current page. So: When viewing home page, you see links to its 3 children (about, site map and templates) + the "orbit images", i.e., renderOrbit($page->images. When viewing about page on your site, you see links to its 2 children (Child page example 1 and Child page example 2) and 3 children (in the PW default install with Foundation example - Child page example 1, Child page example 2 and Typography Tests) As for HTML code in the template files (/site/templates/), these are mostly in _main.php, I believe. Create a local (WAMP/XAMPP, etc) test install of PW using Foundation profile (although I'd suggest you start with the default profile). In /site/config.php, turn debug on (true). Then, I suggest to go through each and every template file used (minus admin.php). There's only 7 of them. That way, you'll see and study what's going on behind the scenes, follow the code to see where the rabbit-hole leads. Test things. What function calls what? What file is included? Comment and uncomment the code to see what breaks and happens, even deliberately throw in silly undefined variables in the works. What breaks? What error does PW through? Of course this will be a test environment and you can always undo. Write notes along the way (even better as your personal comments within the code itself). Additionally, you can use the trick I showed you above. Look at the HTML source and use things like "id=xyz" and class="abc" as terms to search/grep through the template files in /site/templates to find out where the HTML is coming from.
  6. See my edit above. In my case (am on dev branch) it RESPECTS parent is not (parent!=123)
  7. Regarding selectors, if you think about it, superuser means just that...there are no no-go areas for them . But, like I said, I would wish for admin pages not to be incuded at all (irrespective of selector) in the Page Reference Fields. I can't think of a scenario where even a supersuser, in a Page Ref Field, would want to select pages that should not be viewable at the front (modules, trash, etc.). Let's hear what Ryan has to say Hmmm. That works OK on my end. When logged in as non-admin, I am not able to select children of parent = 1057 in my Page Ref Field...
  8. Hmmm. I have tested this and I think you might have found a bug ( NOT A BUG; SEE BELOW)...The thing is using the ! declaration results in crazy results. E.g. template!=admin, like you've said, returns admin, trash etc. I am testing on dev branch (from a couple of days back). I'll test further before reporting as a bug... Edit: Tested further outputting content in the front end with a find call using a selector "template!=basic-page); If you are logged in as superuser, you will see all pages including trash, roles ,etc (since you are superuser). If not logged in (or logged in as a user with less privileges) you don't get to see those privileged pages (admin, etc.)...I'm guessing that's what's happening in the above case since Alkahest (I suppose) tried above when logged in as superuser. As for parent!=1057, am still investigating that... Edit 2: parent!=1057 (for example), results in the same as above...modules, access pages, can be viewed... I suppose it makes sense though, because the find is specific? Looks weird though in the Page Reference Field even for superusers Edit 3 I don't think this is a bug. @Alkahest, If you use the "Custom Selector" approach, your client will not able to see those admin and setup pages etc in the Page Reference Field drop down since they are not superusers. Try and log in as "client" and you'll see what I mean
  9. There are some videos but nothing about forum modules I am afraid. About a foreign key and its use, I'll let the lead developers answer that. By post you refer to "forum" posts are you referring to the "Discussion" module I referenced above? I am not away of that but please feel free to ask in the support board of that module.
  10. Did you give "client" access in the templates themselves (see my previous posts) I am not following. What do you mean you deselected "Parent" and "Template"? I get you, my bad So they shouldn't be able to pick "A custom menu", "Arbitrary Link", etc? In you setup, which pages should they be able to pick? I can't tell from your post. You must be doing something wrong somewhere but hard to tell at the moment..
  11. Allan, When on the homepage, you are talking about the highlighted content as in the screenshot below, right? If you look at the HTML source of that page you see this code: <ul class="body-nav side-nav"> <li class="divider"></li> <li><a href="/foundation/about/">About</a> <span class="summary">This is a placeholder page with two child pages to serve as an example. </span> </li> <li class="divider"></li> <li><a href="/foundation/templates/">Templates</a> <span class="summary">More about the templates included in this basic site profile. </span> </li> <li class="divider"></li> <li><a href="/foundation/site-map/">Site Map</a> <span class="summary">View this template's source for a demonstration of how to create a basic site map. </span> </li> </ul> Notice the class in the <ul>? It is "body-nav side-nav". If you look at _nav.php, line #100 you see this code: 'class' => 'body-nav side-nav', which is part of the function renderBodyNav. That tells me that function is responsible for the <ul>......</ul> code above. So, we search for instances of that function in our template files. This will lead to 3 places (including search.php) but the ones we are interested are on home.php (used by "home" page) and basic-page.php (used by "about" page and others I presume). What the code does is this: In the case of home.php, it looks for the children of "home" and creates a list with links to those pages (and appends them to $body). I haven't thoroughly looked at the code but I believe there would be a limit clause somewhere so you do not get all the children of the home page (they could be many!) $body .= renderOrbit($page->images) . renderBodyNav($page->children);//home.php Change that code to this $body .= renderOrbit($page->images);//home.php We have now removed the call to renderBodyNav. I understand, the name can be misleading, but look at this way...the list is just a navigation; a navigation to child pages. In the case of basic-page.php, the code first checks if the page being viewed (in this case pages using basic-page.php as their template file) has children (the $page->numChildren(true)). If it does output the child pages as a list (appending them to $body). If it doesn't, do nothing... If you don't want the list of child pages to appear in pages using basic-page.php (like "about" page, I presume), then change: if($page->numChildren(true)) $body .= renderBodyNav($page->children); //basic-page.php to this; we just comment it out. //if($page->numChildren(true)) $body .= renderBodyNav($page->children); //basic-page.php Test this and see how it works. I haven't studied the code in-depth so check if there are consequences in output that comes after that list... I suggest that you read up on PW, specifically these documents: http://processwire.com/api/selectors/ http://processwire.com/api/variables/page/ http://processwire.com/api/variables/pages/ Also, check out the PW wiki and go through the tutorials. This way, your experience with PW will be much richer and you will be amazed at how quickly you can build things with the system. I am not suggesting that you should not ask questions. I am saying if you understand the system, you will have much more fun and satisfaction when you look back at what you've accomplished and there will be less hair pulling (your hair, not mine, hehe)
  12. Hi Allan, In future, please post questions related to the Foundation Profile in its forum support thread here: http://processwire.com/talk/topic/4014-zurb-foundation-4-site-profile/ Make's it easier for the developer to pick them up plus keeps everything related together Qn#2: That seems to be coming from these code in basic-page.php and home.php templates files which are calling the function renderBodyNav (see this) in _nav.php $body .= renderOrbit($page->images) . renderBodyNav($page->children);//home.php if($page->numChildren(true)) $body .= renderBodyNav($page->children); //basic-page.php How comfortable are you with PW and PHP? I'm just wondering if the code in this profile may be a bit advanced for you at the moment?
  13. Hi dhruba, Welcome to PW and the forums! There has been talk about a forum module for PW but nothing has materialised so far. There's these topics that could be of interest: http://processwire.com/talk/topic/3536-forum-integration-module/ http://processwire.com/talk/topic/572-release-discussions/ Could be relevant: http://modules.processwire.com/modules/fieldtype-comments/ http://modules.processwire.com/modules/process-latest-comments/
  14. Jasper I think what's being said is that the code has: status=published which is not valid. What is valid is status=unpublished. So, I suppose, if you want to check if published, you negate the status, i.e. status!=unpublished. I'm probably misunderstanding what you are getting at
  15. @Pete...something like this? http://processwire.com/talk/topic/4147-excel-like-crud-in-pw-using-handsontable/
  16. In some previous posts, I demonstrated a simple proof-of-concept CRUD “application” for PW using jTable. I really wanted to use DataTables since it is older, wiser and with a huge fan base. One thing I wanted was for the CRUD system to be as simple as possible and possibly be Excel-like (more below). With DataTables plugins, you can perform stuff like inline-editing and Auto-fill. The latter works just like in Excel and allows you to quickly populate cells (quick copy). But that’s as far as it goes. Google led me to other Table management systems. Some of the front runners include jqGrid and SlickGrid. SlickGrid is nice and using virtual rendering can display millions of rows with ease. Its support for displaying data delivered on demand (Ajax/server) is minimal; it requires you to download all your data before it starts manipulating it. Someone has created an Excel-like extension for it allowing copy-pasting between SlickGrid and Excel. Awesome! But, it still didn't rock my boat completely, especially the Ajax content issue. Then I stumbled upon Handsontable, a new kid on the block that describes itself as “a minimalistic Excel-like data grid editor for HTML, JavaScript & jQuery”. Though relatively new, it is as Excel-like as you can get. You can copy-paste from/to Excel [single to multiple cells and multiple to multiple cells], use the usual shortcuts (Ctrl-A, Ctrl-X, Ctrl-C, Ctrl-V, Ctrl-Y, Ctrl-Z - i.e., undo/redo, etc., and tab navigation, etc.), use Auto-fill (vertically and horizontally), freeze cells/columns, make cells/columns read only, Right-click context menus, insert/delete rows and columns, perform inline-editing, etc. Double awesome! Handsontable (HoT) is minimalistic but comes with a rich API. However, most of the implementation is down to you (sounds familiar?). It will render the Table and provide you with Methods/Events/Options to manipulate it. You just have to provide the data as an Array or JSON defining your columns and containing your data. Soma has a DataTable module that is currently read only; you cannot edit the displayed data directly in the table. It is also in lazy development . So, I started toying with the idea of using HoT as an Excel-like CRUD system (module) for PW. I wanted something that could quickly and easily do mass editing (Batcher-like). Imagine quickly creating basic pages/records by copy-pasting from Excel. Or quickly changing records by dragging (Auto-fill) or pasting new values over old ones. Well, the result can be seen in the screencast below. I’d like to hear your thoughts whether this is something that I should consider developing into a module; something that could be used by Superusers. Depending on implementation, it could be used by other users as well. All HoT needs is data. What you do with that data is up to you (the developer) and your code! This can be very dangerous if not implemented correctly, of course! You could easily delete important records! However, HoT does not touch your database! Deletions, insertions, etc., will not alter your database unless you specifically write the PHP code to do that. All it does is send data to the server via a method your specify (post, get, Ajax, etc.), and even that is your implementation. You do not need to implement deletions or additions. You can use it for updating content only or as read only, but where’s the fun in that ? In the screencast , apart from the table itself, all the other implementations are custom - the buttons, selects, auto-save (can be tricky? can DDOS your server?). The current implementation is not perfect; it is a demo after all. Certain stuff would need to be implemented differently . I didn't want to spend too much time on something that would not be useful in the end. All CRUD operations are via PW API and/or vanilla PHP. Deleted pages are Trashed and not permanently deleted. If there is interest for a module of this kind, I would request all the help I can get to develop it please. I would put it up on Github of course. In the demo, this is running off Diogo’s ACP module. Let me hear your thoughts please. Should a module like this see the light of day? Thanks Wasn't sure in which forum to post this...
  17. Brilliant! Glad you got it sorted.. Useful links for upgrade: http://processwire.com/talk/topic/530-profile-export-module-also-upgrade-pw-20-to-21/ http://processwire.com/talk/topic/853-processwire-22-soft-launch/ https://github.com/ryancramerdesign/ProcessWire Welcome to PW and the forums..
  18. Hi Debbylevinson, A quick one. The most important thing to do before you try to recover the site is to backup the /site/ folder and the database if you haven't done that already. Make sure you do that before taking any action. I'm pressed for time ATM but you have several alternatives...Before that... check in /wire/config.php There you will see the ID of the superuser and the role ID of the superuser. In PW 2.3 these are 41 and 38 respectively. You can also see this in phMyAdmin if you look under field_roles and pages. So, under the table "pages", find the name of the page with ID 41 (see "name" column). If you are still unsure about what to do, I'd be happy to chat via PM.
  19. Peter, Not really...the all implies both hidden and unpublished + pages not normally viewable by the current user..
  20. Peter, You are right, the docs should be tweaked to specifically say although get() assumes include=all, that only applies to pages NOT in the Trash.
  21. How do you mean Pete? Editing repeaters using DT?
  22. Peter, Glad you got it sorted. Two comments With respect to all pages, as you can see from my examples above and from the quote below, using get() with "include=hidden" (and check_access=0) is basically redundant. get() will grab hidden stuff NOT in the trash without that selector anyway but will NOT get stuff in the trash. So, get() without these two selectors should suffice in this case. Secondly, since $page always returns the current page, I'm wondering why you need to create a variable to hold the current page id ($current_page_id)? The following... id!=$page->id should work.
  23. Peter, I've tested using both dev and stable versions with same results. How does your selector look like? I queried by title. $pages->get("title=robinhood");
  24. @Allan, Glad it's working. Ryan (lead dev) will have a look at that code; if not we'll let him know...
  25. Apeisa, Hehe, I read that as 5.2.1.7...I need my glasses, hehe! Thanks..
×
×
  • Create New...