Jump to content

ottogal

Members
  • Posts

    339
  • Joined

Everything posted by ottogal

  1. As superadmin I often use some tiny HannaCode for testing purposes. To avoid any irritation I would like to hide them from the list of available HannaCodes seen by editor users when they right-click in the CKEditor field. Is there a way to achieve this?
  2. Sorry, posted in the wrong thread. Sorry again, it was the right place. Because you referred to it in the following post, I try to redescribe what I proposed: Use a variable $my_path = $path_template . "/myAppDirectory"; and modify the code to echo $my_path . "/js/createjs-2015.11.26.min.js"; Sorry that it was not helpful - and to all for the confusion!
  3. Dear all, I want to apologize for my harsh comment which was a spontaneous reaction and not well thought-out. I highly appreciate the spirit of this friendly community and didn't want to hurt anybody. Those of you who have read more of my posts know that usually I try to be constructive and not a troll. Best wishes ottogal
  4. Are you joking?
  5. To be more explicit: See this codepen.
  6. Hi VirtuallyCreative, instead of $homepage = $pages->get('/'); foreach($homepage->and($homepage->children) as $child) { you might try this $homepage = $pages->get("/"); $children = $homepage->children; $children->prepend($homepage); foreach($children as $child) { (Found in this thread.)
  7. Hi all, this article on CSS-Tricks: Transparent JPG (With SVG) might be of interest for some of you. Kind regards ottogal
  8. Hi Jon, nearly a year ago you asked a $session related question. There were some hints in the answers, weren't they?
  9. Thanks mr-fan - that seems to be a nice idea! I for sure will take a nearer look into it - after my actual problems hopefully will be solved... (I've got a similar Hanna Code to display a Video, using the jQuery plugin VideoJS - which mostly works well, but not on some mobile devices, e.g. on WinPhone 8 or iPhone...)
  10. Thank you, Robin S. It's so easy to make CKEditor get worried. Your trick prevents the warning message, so it looks less worrying to me...
  11. Hi all, distracted for a while by other (bigger) problems, I now came back to the situation discussed here in this thread in october: For my Hanna Code call [[mp3 audio='LINK']] now I have this Hanna Code (mp3.php): (and all works fine - ) <?php $a = new SimpleXMLElement($audio); $pagelink = $a['href']->__toString(); $pagename = basename($pagelink); $ap = $pages->get("template=audio,parent=audiopool,name=$pagename"); $link = $ap->mp3->url; ?> <div class='block'> <audio controls width='400'> <source src='<?= $link ?>' type='audio/mp3'> </audio> </div> <p><?= $pagename ?></p> But when I open the Hanna Code in the editor and click the button "Save & Test", I get the following messages: The line number refers to the file ....../site/assets/cache/HannaCode/mp3.php where the line and a blank line are prepended - so the line in question is, of course: What is wrong with the code, and how can I get rid of these Warnings? Thankful for some clarification: ottogal
  12. I would like to join, but only beyond 9th of january.
  13. ottogal

    NexWafe

    Great! That for sure is a candidate for the Site of the Week...
  14. BTW: Shouldn't that be $pages->find( So that naming is rather misleading. A proposal (written just here, not tested): foreach ($categ_team as $categ) { $content .= "<h2><a href='{$categ->url}'>{$categ->title}</a></h2>"; $cat_members = $page->find("template=member, featured=0, categ_team=$categ"); $years_start = array[]; foreach ($cat_members as $cm){ $years_start[] = $cm->date_begin; }; $years_start = $years_start->unique(); foreach ($years_start as $y){ $content .= "<h3>{$y}</h3>"; //or apply some formatting to the $y value $members = $cat_members->find("date_begin={$y->date_begin}"); foreach($members as $m) { $content .= "<h4><a href='{$m->url}'>{$m->title}</a></h4>"; } } } Edit: Small correction.
  15. I'm guessing: The 2013 sub-list is showing up twice, because there are 2 members having this date_begin - and if you had 3 of them, it would show up three times...? $years = $page->find("template=member, categ_team=$categ"); I think this PageArray will contain each year several times - one for each member having the same date_begin. You could try $years = $page->find("template=member, categ_team=$categ")->unique();
  16. Hi all, the renowned German magazine for computer tech, c't, in its most recent issue #25/2016 is presenting several "WorldPress alternatives", and ProcessWire is among them. (My translation.)
  17. Since you use 'item_tpl' => '<a class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false" aria-controls="navbar" href="{url}">{title}</a>', these classes of course will be added to all the <a> elements, independent of the <li> having has_children or not. The point is that the class has_children is an optional class for the <li>, not for the <a>. So a workaround could be changing the CSS. Assuming your class dropdown-toggle is defined like this: a.dropdown-toggle { /* your styles here */ } Then change this to li.has_children > a { /* your styles here */ } So your styles are applied just to those <a> elements which are direct children of a <li> element having the has_children_class. (Didn't try it, just written here...) A quite different (and way more complicated) approach would be the use of the "hook for custom item string (new in 1.2.0)" - see the README of http://modules.processwire.com/modules/markup-simple-navigation/
  18. Thanks to both of you for the clarification. I'll give it a try.
  19. Great idea. Just a thought: Couldn't it be overkill to pass the whole $page object to the function (in case it has a lot of properties&methods, and the file to render needs just a few of them)?
  20. Why didn't you try what Robin S proposed above:
  21. I'm observing this behaviour every now and then, with different AsmSelect fields (not in a repeater). But it doesn't seem reproducible, it's a randomly ocurring phenomenon. I assume it's a problem of Firefox, not PW.
  22. "subfiles" here means partials to be included? And even more? Hanna code?
  23. @Robin S Good find, thank you! After this change even my simple use of the function strstr() works - to crop the string on both ends, setting free the href attribute value: <?php $f = (string) $file; $f = strstr($f,'/site'); $audiofile = strstr($f,'">',true); ?> <audio controls> <source src='<?= $audiofile?>' type='audio/mp3'> </audio> Your second hint to use SimpleXMLElement() of course is a cleaner way to do it: <?php $a = new SimpleXMLElement($file); $audiofile = $a['href']->__toString(); ?> <audio controls> <source src='<?= $audiofile?>' type='audio/mp3'> </audio> Didn't know this class before - so again I learnt something new. Thanks a lot again!
  24. Hi all, I'm struggling with a problem which is more a PHP issue than one of Hanna Code. <?php ?> <audio controls> <source src='<?= $audiofile?>' type='audio/mp3'> </audio> This little HC works fine when used in a textarea/CKEditor field like this: [[audio file="/site/assets/files/1234/foo.mp3"]] Now I wanted to make it flexible and enable the editor user to insert the path to any mp3 file (stored on some page in a field "mp3" of type File, allowed file extension mp3). In the HC Attributes I set a default value for $file, defining file=LINK . Now the editor, inserting the HC using the HannaCodeHelper Module, gets [[audio file="LINK"]] The aimed workflow for the editor user was: Double click on LINK to mark it and using the Link button of the CKEditor to choose the wanted file from the wanted page. Obviously, the value created by CKE had to undergo some treatment. Of course it's a link from which I had to extract the value of the href attribute (here /site/assets/files/1122/bar.mp3) , but because of the double quotes from [[audio file="LINK"]] it would become "<a href="/site/assets/files/1234/foo.mp3">" where the second " would terminate the string. I tried string functions str_replace(), strstr() etc. but to no avail. Perhaps I could have used Javascript, but I wanted to find a PHP solution. Could anyone help on that?
  25. Hi all, to open a certain page for editing you can use $session->redirect($mypage->editURL); But what when you would like to open the Children tab of that page instead? Just change it to $session->redirect($mypage->editURL . '#ProcessPageEditChildren'); I found it hovering over that tab: The status line shows the additional "#ProcessPageEditChildren". Perhaps this could be useful for some of you...
×
×
  • Create New...