Jump to content

Soma

Moderators
  • Posts

    6,808
  • Joined

  • Last visited

  • Days Won

    159

Everything posted by Soma

  1. Cool, glad it works better now! Thanks. I just changed the toggle behaviour... and it's inline now. Also changed descr font to monospace default.
  2. Yeah your right, but I'm working hard on it ... Can you try again , just updated improved live search version. -- Thanks for your feedback and ideas. I will certainly consider some of those.
  3. This is correct, but not using the page->render module method I mentioned. Assuming you have a template setup for the side panel with a php file like this: <div class="side_panel"> <h4><?php echo $page->title; ?></h4> <?php echo $page->body; ?> </div> Assuming the page field is allowed multiple, then your code could be: <?php if($page->side_panel) { foreach($page->side_panel as $p) { echo $p->render(); } } $page->render(); just renders your side panel page using the template file with the variables filled in. Then you can have multiple different side panel types with own templates and fields for own purposes. Hope that makes sense.
  4. Yes, it has a search heuristic which find also wrong spelled word similarities. I can't really agree that it's not desirable, I like how it works to filter and also find similar matches, which can even be helpful if you consider it. Like config->modules find more than just the exact match. It's just that I can't figure the best setting and think it's stumbling over the -> chars, and because of the description texts adding to the results.
  5. Thanks for asking. I use some code from JResig from a while ago, he showed an improved example for someone elses live search. It's using quicksilver js for scoring. So it checks for if score > 0.1 , which is pretty lazy and finds many things. I tried to find a setting which is a good balance, but it's two sided sword. BTW, the hidden description texts also count. Also if you enter -> or $ it works better. If I set it to > 0.5 or 0.8 it seems to not find stuff that should... I don't know if it has to do with the $-> chars. I'm still trying to see if I can improve it, I'll try to do some investigations. But also would like to hear what you think - try again using the -> in search..
  6. Ah haven't done that yet. Thanks for the tip. I've tried and created a branch and now I'm a little confused with those two separate branches "master" and "gh-pages". Is there a way to have the master always getting pushed to the gh-pages? The github project page is now available here: http://somatonic.github.com/ProcessWireCheatsheet/
  7. Then you have Courier set in Chrome as default monospace font (it's the default). It works all well for me in Chrome and all others. Don't know if I'll change it back, now that it's configurable I don't see any big level of complexity here. --- May be best to just specify monospace as font, so whatever you define in your browser is chosen. Since courier is default in all browser I would be fine with it. I quickly changed it, can you have a look diogo if that works for you, I guess you'll still see courier... Anyway, for the font sizes, not each font will render same size consistent, that's why you seen the font size change because I defined "Courier New" and your default monospace is "Courier" and set different size or may render differently for you.
  8. Thanks, can you try again with chrome? It works for me the browser default monospace is shown for me...
  9. ahh Thanks apeisa for the head's up that makes sense now... You mean if you select monospace? What browser? For me it also shows courier, dunno what my default monospace font is
  10. I used to do it like this: Add page reference field, that configured to allow to select pages with template "sidebar" for example. This sidebar template has just title and body and may other fields. Now add a page tree section ie "Sidebar Elements" in the tree, where you create the sidebar pages. Now on your normal content pages you can select 1 or more of them through the page reference field and even sort them. You can then render them using foreach over fields or using ->render method (need to install the module I think) for pages to render them using their own template file, which would only contain the markup for the sidebar element of course. There's a few more options and ways to archive this, but this turnes out to be very flexible and easy. You could also inherit those to while sub page branches aswell, like the mood image on basic site.
  11. Thanks guys, I'm really happy how it turned out and glad you guys like it. I added some more for markup pager and page fields and some more selector properties. I also added some font options now. It's better to have that optional. I can't say what font works best for you, I don't even have monospace installed... I changed default to Courier New, don't know if that helps. But now you can chose one you like. Ryan, I would be very thankful if you could help a little with looking through if there's anything you would add, or maybe you spot something wrong or something really important that we forgot we could put in. – I don't know if Fuel would have to be added like Nico suggested. Breadcrumbs? That's something really easy to form with foreach over ->parents array, breadcrumbs does also only that I think. I don't want to add every little bit that's in PW, but the most useful for reference.
  12. I finally started a Cheatsheet for ProcessWire2.1+ Now it's also on processwire.com (auto fetching it from git) http://www.processwi.../api/cheatsheet The github project page: http://somatonic.git...WireCheatsheet/ And there's the git repository: https://github.com/s...sWireCheatsheet I'll continue to add or remove things as times goes by. At some point this will get converted to a PW App. 02.06.2012: - added with $input->urlSegments - added support for GET param in url to &filter and set &advanced - added support for hash in param to filter section 06.02.2012: - updated urlSegment($n) description to avoid confusion - remove some of the alternative syntax 17.12.2011: - added new section "Files" to the sheet - minor structuring of some advanced entries 08.12.2011: - added fix to menu when scrolling - moved some entries to advanced mode - added toggle button on sections - minor changes 04.12.2011: - some restructuring, adds and removes - minor tweaks overall, typos, ordering - added "advanced" mode 27.11.2011: - Added index collumn on left side - You can now toggle sections using the index - Also toggle show/hide all description of a category when clicking on blue titles. - It resets all if you click in the table somewhere (in white space) ADVANCED mode: Mainly it started with only "System Configurations" being advanced, but I added many of the more advanced functions overall. I don't know if it really is the thing to go, but I thought why not try to have very simple and basic version so it would fit on a matchbox . So they're my guess on to what would be the more advanced stuff, and I had kinda hard time to decide what to do and how. After long back and forth I decided to just give it a go and see what people think. Filter I noticed that in mozilla, the live search filtering wasn't working after the changes i've done to it. I figured mozilla has no innerText, which is very practical to get content of a node but not subnodes. I had to use textContent, which returns all text including subnodes, so the search filter doesn't work as good as in other Browsers. May I find a way to work around it. *Found that restructuring the markup was the only way to solve this problem. It should also now work much better in FF for the live search. --- Bug reports, feedback and suggestions are always welcome. Hope you like it!
  13. Ther error log works. THe error messages overlap the table, they're too long to fit in the cells. I suggest to trim them to 50chars and when on hover show the message in a layer? Or use collapsible InputfieldWrapper fieltype to make each error an element, with the date time and cut message as label, and if open show the whole message. Just ideas. Also when I clear the log... I get this notice: Notice Undefined index: file in /site/modules/ProcessLogs/ProcessLogs.module on line 52 Notice Undefined variable: errors in <b>/Applications/XAMPP/xamppfiles/htdocs/pw2.ch/site/modules/ProcessLogs/ProcessLogs.module on line 76 If I select the LoginNotifier Log it shows me these: Warning: array_combine() [function.array-combine]: Both parameters should have an equal number of elements in /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/site/modules/ProcessLogs/ProcessLogs.module on line 69 Warning: array_combine() [function.array-combine]: Both parameters should have an equal number of elements in /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/site/modules/ProcessLogs/ProcessLogs.module on line 69 Warning: array_combine() [function.array-combine]: Both parameters should have an equal number of elements in /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/site/modules/ProcessLogs/ProcessLogs.module on line 69 Warning: array_combine() [function.array-combine]: Both parameters should have an equal number of elements in /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/site/modules/ProcessLogs/ProcessLogs.module on line 69 Warning: array_combine() [function.array-combine]: Both parameters should have an equal number of elements in /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/site/modules/ProcessLogs/ProcessLogs.module on line 69 Notice: Undefined index: page in /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/site/modules/ProcessLogs/ProcessLogs.module on line 82 Notice: Undefined index: type in /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/site/modules/ProcessLogs/ProcessLogs.module on line 83 Notice: Undefined index: description in /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/site/modules/ProcessLogs/ProcessLogs.module on line 84 Notice: Undefined index: user in /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/site/modules/ProcessLogs/ProcessLogs.module on line 81 and it doesn't show the log messages, just a table with 20 times the same date time... Do you know the login notifier is configurable and its possible to define own fields that get logged? How are you handling this?
  14. I could also need something similar. I just used symlinks on domain folders on server to point to one pw install. I then have redirects to /en/ /de/ ... For the other domain I chose /de-ch/ and /en-ch/. But I would like to put them in subfolders like /domain1/de/ and /domain/en/ etc. but then the additional path would show in url, which I didn't see any easy way. But then I also didn't come ask here . I was thinking about something like configurable routing lik ein codeigniter for example.
  15. I want a Cheat Sheet! I could do one.
  16. Dates are stored as timestamp not in the format you specify. It will be formated when output. So you would have to use a timestamp to use in the selector. For recieving page of today, you would have to create a start and end time range and use them in the selector. <?php $start = strtotime( date('Y-m-d') . " 00:00:00"); $end = strtotime( date('Y-m-d') . " 23:59:59"); $items = $pages->find("template=linkmain,publishdate>=$start,publishdate<=$end,sort=-userid"); haven't tested it but should work along these lines
  17. I already tried with "u" ... It doesn't work on my side. --- Now if I remove the first <p> in the regex it suddenly works even without "u" ! But then I got a broken p tag.. If this works for you, there must be something with my local installation, php or db? Would that make sense? I'm definately doing nothing wrong here, I checked so many times now.
  18. I tested them al already, \s \040 " " ... if I do an encode it doesn't help. I know am testing and searching since hours and can't find anything. But there's definately TinyMCE where the problem comes from (again). It seems a whitespace at the beginning of a line, TMCE enters some weird unknown invisible char, second whitespace then is a normal one. If I go into DB to look at what's in table, it just shows a normal space " ", and if I'm retyping it in DB with a space, suddenly it works...
  19. The regex isn't wrong I just played around with it trying to get it to work (but you're right it isn't neccessary), it works well like this for optional whitespace between <p> and http, but somehow the whitespace is different in the <p> http://</p> that gets returned from the $page->body from TinyMCE for some reason I can't figure out. I tested this for hours, and It drove me nuts literaly. If I test it with a simple /\s+/ and replace every whitespace, for example with a string "SPACE" , all whitespaces get's replaced except the one in the <p> http://... </p>. So I can't really figure out what's up with this. --- jsut tested your regex and it doesn' work for the same reason as mine doesn't with whitespace in front of http...
  20. This should work. $page->body = preg_replace("#<p>https://www.youtube.com/watch\?v=([a-zA-z0-9\-\_]{11}).*?</p>#is", $replacement, $page->body); But if I put a whitespace before the http like "<p> http:// ... </p>" I can't get it to work with what's comming from $page->body: $page->body = preg_replace("#<p>\s*?https://www.youtube.com/watch\?v=([a-zA-z0-9\-\_]{11}).*?</p>#is", $replacement, $page->body); If I test it with a string it works with the whitespace... $str = "<p>Paragraph before video</p><p> https://www.youtube.com/watch?v=9e-57gmA67o&feature=feedrec_grec_index</p>"; $replacement = '<iframe width="480" height="360" src="https://www.youtube.com/embed/$1" frameborder="0" allowfullscreen></iframe>'; $page->body = preg_replace("#<p>\s*?https://www.youtube.com/watch\?v=([a-zA-z0-9\-\_]{11}).*?</p>#is", $replacement, $str); echo $page->body; So aslong as you don't have a whitepsace before url it works. Maybe someone else know what's going on.
  21. Well I still got a problem with <p></p> before the <p>http://www.you... they also get included, but don't know why. I'm trying to get it work with optinal whitespace before and after the url... as soon as you have a whitespace in front of http:// the previous <p>'s also get replaced.
  22. I think this should be ok, can you also test? $page->body = preg_replace('#<p>.?https://www.youtube.com/watch\?v=(\w{11}).*?</p>#is', $replacement, $page->body);
  23. But for me, everything else stays the same... The regex assumes the link is in a <p></p> ... You could remove the first line... too "if(strpos($page->body, '<p>https://www.youtube.com') !== false) {" Ahh, now... I could reproduce, if there other <p><p> after or before is the problem. I'm not a master at regex, but I'll try to fix
  24. You're welcome. Sorry, I got something wrong. I updated the code. The $body variable was wrong it should be $page->body = But just tried, it should work, what do you mean by entire body field?
  25. $replacement = '<iframe width="480" height="360" src="https://www.youtube.com/embed/$1" frameborder="0" allowfullscreen></iframe>'; $page->body = preg_replace('#<p>.*https://www.youtube.com/watch\?v=(\w{11}).*</p>#is', $replacement, $page->body); echo $page->body;
×
×
  • Create New...