kongondo

PW-Moderators
  • Content count

    5,049
  • Joined

  • Last visited

  • Days Won

    72

kongondo last won the day on February 19

kongondo had the most liked content!

Community Reputation

5,453 Excellent

2 Followers

About kongondo

  • Rank
    Hero Member

Profile Information

  • Gender
    Not Telling
  • Location
    UK

Recent Profile Visitors

24,784 profile views
  1. @bernhard, @dragan's is different (e.g. it has image search in there) from the one I use which I think has been around a lot longer .
  2. Excellent! I don't think you need $u->of(false) for a new record/page, btw. Btw2, I testing saving a field in an existing $mainsite->somePage and it worked OK. However, I noticed two things: I expected PW to throw an error if I attempted to save the page without turning output formatting off, but it didn't Reloading the page where I was viewing content from $mainSite->somePages, the changes made to the above field were only visible after a 2nd reload Did you experience this @modifiedcontent?
  3. Similar(-ish) issue?
  4. Yeah, I can confirm this. From my testing ,$mainsite does not seem to have access to $session. Security? I don't know, just guessing.
  5. Forgot to show where $forum is defined in your example code? Would be good to show the complete, correct code to help others, thanks.
  6. Hmm, why? Do you have an upcoming project? Although we are in 'Off Topic', I don't get the point of starting a new thread instead of 'continuing' the discussion (if there is one), using the existing threads:
  7. Yeah. I've had it in my signature for ages (so, you see, we are not so clever ) . I can't remember who created this particular CSE though. I also have it bookmarked in my bookmarks bar for easy access.
  8. Hi @hezmann That's because the code (in the field) is locally scoped so that $page refers to the page you are editing. However, if using wireRenderFile(), you need to get the page being edited yourself. When editing a page, the page (named) edit is what ProcessWire assigns to $page. The page edit has the id 10. So, what you need is code like below to get the page being edited: $currentPage = ''; $process = wire('process'); if($process && $process->className() == 'ProcessPageEdit') $currentPage = $process->getPage(); if(!$currentPage) return; // if you get here $currentPage is the page being edited More in this post. Sorry, this should be in the docs. I will update the docs at some point (when I get the time). Hope this helps.
  9. No worries . Btw search tip: Use this one instead: E.g., searching for restore trash page or restore trash page api returns $pages->restore() as the second result and your question as the fifth .
  10. // Grab a page from the trash and restore it $trashedPage = $pages->get(1234); $pages->restore($trashedPage); http://processwire.com/api/ref/pages/restore/
  11. @andrew24, Moderator Note Please consider this your first and final warning against spamming in these forums. This forum is for ProcessWire jobs. You had hidden a link to your non-ProcessWire CMS behind your email address. I have removed your email and the said link.
  12. I'm totally clueless about this . I'll have to investigate, but it might not be soon, I'm afraid. I need to finish work on some other module first, before I can turn my attention to Matrix. Thanks for reporting.
  13. Hi @OllieMackJames, This is a basic example because I don't know what want to do with the contents of page2use4homepage. $content = ''; // if page2use4homepage is a multi page field if($page->id == 1 && count($page->page2use4homepage)) { foreach ($page->page2use4homepage as $p) { $content .= $p->title;// @note: $p is a page; you can access all its properties } } /* // if page2use4homepage is a single page field if($page->id == 1 && $page->page2use4homepage) { $content .= $page->page2use4homepage; // alternatively, you could create a property on the fly and assign to $page, e.g. (a silly example) $page->content = $page->page2use4homepage->id; } */ else $content = $page->body; // do something with your $content You don't want to do this. You are overwriting $page which is a native ProcessWire variable. Same goes for $pages, $template, etc. You want to use different variable names (in general) I highly suggest you go through some basic PHP tutorials. It might seem hard at first but the benefits thereafter will be worth it. Otherwise, copying and pasting code will only get you so far. Please don't take offence; just friendly advice .
  14. These topics might be of interest, especially Macrura's dashboard And this module (page list hidden by default)
  15. Welcome to the forums @activestate. Have a read here about selectors, specifically about MySQL and short words. Please use code blocks (@see the <> icon) around your code.