Jump to content

jom

Members
  • Content Count

    18
  • Joined

  • Last visited

Community Reputation

10 Good

About jom

  • Rank
    Jr. Member

Profile Information

  • Gender
    Male
  • Location
    Zürich
  1. ok, this works. I begin to understand slightly more about the mechanisms 🙂 - thanks!
  2. I have a follow up question: How can I get access to the active page from within the __constructor? Something like this: public function __construct(Template $tpl = null) { parent::__construct($tpl); $this->header = page()->title; //does not work } I guess, I have to pass the active page to the constructor? But how/where? In my page template file programmliste.php I refer to the custom class like this: $content = page()->header(); Including the active page here is too late, as the the custom class has already been created, I guess?
  3. ok, beauty, this works. thank a lot, I appreciate very much!
  4. Hi I've started working with custom page classes. The basic example from Ryan's blog post works fine. Now: I'd like to set some object variables, which I can use in my methods. Usually this is done within the __constructor() method. My simplified example: <?php namespace ProcessWire; class ProgrammlistePage extends Page { public $header = ''; public function __construct(){ $this->header = 'some text'; // parent::__construct(); } public function header() { return $this->header; } } This results in an error in my nav func
  5. Chäs & Co is a b2b cheese trader. They love good cheese and are proud of their excellent knowledge und connections to small cheese producers. They maintain a custom made database and used to copy/paste (!) the cheese infos to the former CMS (Contao). Since substituting the database with ProcessWire was no option, they export now the database to a csv file and import it to the new website (expanded version of module ImportPagesCSV). From there, the pw magic begins. The staff works with the admin interface: They search and find products in notime using the build-in search field (using c
  6. beauty! Works perfectly well - thanks! I got stuck in the forum search, looking for admin live search and integer values. I cite here the code, just in case:
  7. i'm at the same point as Ipa: need to add a number field to the admin live search. do I have to copy the module to the site/ folder and change it there?
  8. just for documentation purposes: looks like Ryan added an option in $config: $config->maxUrlSegmentLength = 128; see also:
  9. I just noticed that the folders are deleted now. So maybe it's all fine now. Does anyone know how the deletion works? Does PW execute some cron jobs from time to time which runs over the temp directory?
  10. Olsa, thanks for Somas post. This might be a solution, if wireTempPath won't work. I still hope to get to work. The question is actually quite simple: How can I get wireTempPath to delete it's folders?
  11. Hi everyone It seems that I don't fully understand the wireTempPath() function and I need some help. I use wireTempPath() to create a new location in assets/cache/WireTempDir and than copy a pdf from the assets/files/page folder to the new folder. I want the file to be accessible only for a limited time, that's why I use wireTempPath. The file seems to be copied to the right location, but gets deleted right afterwards, according to As mentioned in the topic above, $wireTempDir->setRemove(false); prevents the file to be deleted. But I like the file to be automat
  12. Hi I'm also playing with Ryans new module LOGIN/REGISTER/PROFILE (LoginRegister). I wonder if it's possible (and if it makes sense) to use it without the login/profile functionality. I need a registration form for the newsletter. The only fields I need are mail address and user name. I can't get rid of the required password field. I could hide it in the frontend of course and fill it with some generated data, but that's not very elegant. Actually I already have a working solution with SimpleForms, I just thought it might be more straight forward to use Ryans basic module. - What do you th
  13. In the meantime I got the mod_rewrite error log. Indeed, there is an error regarding my topic: [Wed Oct 05 18:42:00.073367 2016] [core:error] [pid 85277:tid 34669321216] (63)File name too long: [client 12.34.56.78:54004] AH00127: Cannot map GET [here follows the repeated path] It seems the paths gets in a loop - it is about 10 times repeated in one string. Now I'm lost - where to go from here? By the way in the first repetition the path is including the urlSegments, the following repetitions are without.
  14. I'm on a shared hosting environment, not sure if I can get the mod_rewrite logs. I asked the hoster for it. In the meantime I implemented a workaround. Since the urlSegments are not vital, I skip them, if a 404 is based on a too long page name. For this I wrote a function which hookes into pageNotFound: public function init() { $this->addHookBefore('ProcessPageView::pageNotFound', $this, 'displayItem'); } public function displayItem($event){ // redirects to url without segments, if there is a long page name involved $pageWithLongTitle = '';
×
×
  • Create New...