Jump to content

marcus

Members
  • Posts

    289
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by marcus

  1. Hi there, in need for a light knowledge base software and not happy with solutions such as MediaWiki, Dokuwiki or Confluence I decided to try to build such a tool based on ProcessWire. At the moment this profile is lacking of features, but doing well in the context it is created for - a somewhat protected simple knowledge base for internal use. It has some basic features but I'm aware that there's still way to go. So if anyone is interested, please find the code attached here or on GitHub: https://github.com/marcus-herrmann/ProcessWire-KnowledgeBase-SiteProfile I exported the data from a PW 2.4 installation, but not have tested it yet against older versions. Installation Before running the installer of ProcessWire copy/replace /site-default/install/ /site-default/templates/ /site-default/modules/ with the folders from this zip. Constraints It's not possible to export user roles with ProcessWire's Site Export Module this profiles templates are checking just whether they are accessed by an anonymous or logged in user. Features Tagging of wiki-articles Set articles to globally sticky ( = for all users) Personal bookmarking of articles for logged in users When using markdown to author wiki-articles, code highlighting via highlightjs Included modules Fredi MarkupSimpleNavigation Hopefully this profile is useful for you in any way. Best, marcus Edit: Forgot GitHub link... ProcessWire-KnowledgeBase-SiteProfile-master.zip
  2. If anyone else also stumbles over this kind of error/phenomenon: In PW 2.4, SiteExportModule works but fails (running into a 500 error) when there's no site/assets/files folder (I guess this happens rarely, but nevertheless... it happened to me this week ). After manually creating this folder, exporting continues and runs smooth.
  3. Hi Soma, thanks for this approach! I was kind of thinking out loudly - I hope it wasn't understood as a feature request and totally can understand that you aren't looking forward to adding every special request into the module core. I'll try to implement a hook like this - thanks again for pushing me in the right direction! Best, m
  4. I'm wondering: is there a way to influence the parent item - like it's possible to influence the current one? A counterpart of "item_current_tpl", such as "item_parent_tpl"?
  5. *facepalm* Thanks! Arrghh....
  6. Hi and once again a newbee question from me... For some reason I am not able to make the following code work. It outputs the navigation not from page 1001 but from the real root, page 1. And I'm scratching my head asking why... <?php $teaser1 = $modules->get("MarkupSimpleNavigation"); $options = array( 'levels' => false, 'max_levels' => 1, 'show_root' => false ); $rootTeaser1 = $page->get(1001); echo $teaser1->render($options, null, $rootTeaser1); ?> Can you help me finding out why it ignores my custom root? And yes, 1001 does exist and has non-hidden children nodes. Thanks in advance! Marcus
  7. *facepalm* I stepped in the ->first()-trap again... From now on I'll place a post it on my monitor, stating "...have you tried ->first?" or "Try ->first() first before annoying people in the PW forums!" Thanks!
  8. Hi, sorry to bother you again -- I'll try not to open topics/asking questions daily The following codes does not work properly and I'm wondering why: <?php $download1 = $pages->get(1014)->download1;?> <a href="<?= $download1->url?>"> <img src="<?php echo $config->urls->templates?>images/pdf.png" /> </a> Ressource 1014 has the field "download1" filled with a dummy pdf, and the URL is printed. But nothing more, ->file, ->filename, ->name, ->ext and so on are empty although the file (dummy_1.pdf) can "physically" be found in /site/assets/files/1014/ Have I missunderstood the Cheat sheet/API in some way? Thanks again! marcus Edit: this code is placed in another template, therefore the $pages->get(1014) instead of $page->download1
  9. Thank you very much, diogo and arjen! Concerning the Code editor: I tried it first, but the post preview populated the php-code with divs and spans all over (though I was pasting it from SublimeText) - anyway...
  10. Hi there, for some reason I do not succeed in doing a simple iteration (in this case with images): <?php $number_of_images = count($pages->get(1012)->images); foreach($pages->get(1012)->images as $image) { $thumbnail = $image->size(118,112); echo "<a href='{$image->url}'><img class='photo' src='{$thumbnail->url}' alt='{$image->description}' /></a>"; if ($number_of_images % 3 == 0) { echo "<p>Insert</p>";} } ?> In this case, there a 5 images attached to 1012, if I echo $number_of_images inside the foreach loop it prints "5". But on the other hand this variable doesn't react on my "$number_of_images % 3 == 0", meaning that it does not insert the <p>...-Chunk every 3 images. Can you help me to find the error in my approach or code? Thanks in advance! marcus
×
×
  • Create New...