-
Posts
4,296 -
Joined
-
Last visited
-
Days Won
79
Everything posted by diogo
-
I'll have a look at it. But I noticed that the core text formatters still use the deprecated format()... Yep, you're right. Not perfect, but you can reduce the output to a targeted node with as a parameter to saveHtml(), so I reduced it to <body> and trimmed the body tags. $str = $dom->saveHTML($dom->getElementsByTagName('body')->item(0)); $str = ltrim(rtrim($str, '</body>'), '<body>'); -- Edit: updated the module with this change
-
https://github.com/ocorreiododiogo/pw-image-fields-markup http://modules.processwire.com/modules/textformatter-image-field-markup/ This is an old idea that I felt inspired to finish after reading this discussion https://processwire.com/talk/topic/9164-release-inputfield-ace-extended/?p=88717 This textformatter does more or less the same that my Image tags texformatter, but instead of using it's own tags, it tries to be completely agnostic while doing this, so you can use whatever method the markup language applied to that field uses. So, for example, If you are using Markdown on your that field, you would insert all images of a field called "images" on that page with: ![](images:0) or inserting the second image from the field called "images" with and alt text of "overriding alt text": ![overriding alt text](images:2) While for textile you would do this: !images:0! !images:2(overriding alt text)! As I said, this is language agnostic, so it should work with any markup language. The trick is to collect the images when they are already html img tags, and intervene only on those that are not urls by changing their attributes accordingly. I used the php native DOMdocument class for this. There are still things to be done, like targeting fields on other pages, defaulting to the first image field from that template and cleaning up a bit. But I'm not planning to do those at this point. Consider this beta.
-
Sure, I'll do it
-
That's a nice one. Love the explanation on the side.
-
Hein?? Why the hell did they call their product Fedora? Edit: to be clear, I don't have a problem with the name itself, but that it's the same as the linux distro.
-
Eheh, I want to see how you are going to correct those two "know" that should be "now" in the text
-
Guys, this thread gave me the impulse I needed to finish an idea that I started long ago. So, here is a new module for using image fields inside textarea using the same markup language that you are using in that same text area https://github.com/ocorreiododiogo/pw-image-fields-markup edit: still testing and work in progress, so I'm not submitting to the directory yet
-
One more: Loop pages in ProcessWire without building a $pageArray. This is useful for when a find() would return too many results to keep in memory. $selector = "template=pages_template"; // as an example while (1) { $p = wire('pages')->get("{$selector}, id>$id"); // get page with id bigger than previous if(!$id = $p->id) break; // assign current page's id to $id or break the loop if it doesn't exist // do stuff using $p as the current page wire('pages')->uncacheAll(); }; This served me well when I had to modify thousands of pages in one go. Works great with bootstrapping from the terminal because it doesn't affect the viewing of the website.
- 89 replies
-
- 12
-
How can I make working links prev and next arrow slide links
diogo replied to Qurus's topic in General Support
That depends a lot of how you are structuring your templates. scripts and CSS should go on the head and before the closing body tag, but this has to do more with markup than PW itself. The example on the Owl docs has everything on the head <!-- Important Owl stylesheet --> <link rel="stylesheet" href="owl-carousel/owl.carousel.css"> <!-- Default Theme --> <link rel="stylesheet" href="owl-carousel/owl.theme.css"> <!-- jQuery 1.7+ --> <script src="jquery-1.9.1.min.js"></script> <!-- Include js plugin --> <script src="assets/owl-carousel/owl.carousel.js"></script> Make sure you call jQuery before calling the Owl script, and follow these examples to adapt the css and script links to point to PW templates folder https://github.com/ryancramerdesign/ProcessWire/blob/master/site-beginner/templates/_head.php#L8 https://github.com/ryancramerdesign/ProcessWire/blob/master/site-classic/templates/head.inc#L32 https://github.com/ryancramerdesign/ProcessWire/blob/master/site-default/templates/_main.php#L39 -
How can I make working links prev and next arrow slide links
diogo replied to Qurus's topic in General Support
Doesn't seem to me that knowing the previous and next items is necessary to achieve that markup. look at the href of the prev and next links: "portfolio_item1.html#myCarousel". This seems like a link to the project being shown, and whatever the problem is, I bet it is not related to the href of those links. Have a good look at the markup that is being generated by your code (view source in browser) and compare it with the html you just posted to see what's going wrong. -
How can I make working links prev and next arrow slide links
diogo replied to Qurus's topic in General Support
As I thought, you don't need to have the arrows on your markup, they should be added dynamically by Owl, See here http://owlgraphic.com/owlcarousel/#how-to Also notice: You don't seem to be using it in your code. -
How can I make working links prev and next arrow slide links
diogo replied to Qurus's topic in General Support
oh, right... I didn't notice that this code is outside the foreach. Sorry Kongondo. Thinking of it, this carrousel code makes less sense to me. Qurus, can you tell us what carrousel is that one? -
How can I make working links prev and next arrow slide links
diogo replied to Qurus's topic in General Support
So, if the field is correctly set and populated, $page->images is the WireArray and $image the item, no? -
How can I make working links prev and next arrow slide links
diogo replied to Qurus's topic in General Support
If the code is the same as in the first post, they are already. The problem must be another. -
How can I make working links prev and next arrow slide links
diogo replied to Qurus's topic in General Support
Use the getPrev() and getNext() methods: <?php echo $page->images->getPrev($image)->url; ?> -- It's better if you keep $page->images in a variable before the foreach, and call the variable instead of $page->images all the time. $images = $page->images; foreach($images as $image): // and later, inside the href: echo $images->getPrev($image)->url -
Just to keep PHP functions out of it $last = $pagearray->pop(); echo $pagearray->implode( ', ', 'title', array('append' => ' & ') ) . $last->title;
-
Or: $last = $pagearray->pop(); echo $pagearray->implode(', ','title') . ' & ' . $last->title;
-
Three new responsive Processwire sites for animation/vfx group
diogo replied to Crawford Tait's topic in Showcase
Sorry, somehow I didn't link to the plugin above. Edited my post to add it. Anyway, the plugin I was talking about—and forgot to link to—, that is compatible with PF is Lazy load XT. See here about its use with responsive images https://github.com/ressio/lazy-load-xt#responsive-images -
Three new responsive Processwire sites for animation/vfx group
diogo replied to Crawford Tait's topic in Showcase
Have you considered lazyloading the images? The site takes a long time to load because of them. I did it some time ago on this page that is quite heavy on images, and I think it works quite well. In that case I used this jQuery plugin, but there is a myriad of solutions out there. edit: More recently I also did it in our projects page, that uses picturefill, forgot about that , I used this plugin since it's compatible with PF. -
If ($page !== $homepage)
-
Guys, look at the date of Adam's post. This was even before ProCache was published—not long before, but still before.
-
You can use iffft https://ifttt.com/recipes/19080-rss-to-facebook
-
I saw all of those already. It's very interesting the variety of apps that you can do based on such a simple idea. Take a look at some more http://en.wikipedia.org/wiki/Outliner (Moo.do is actually missing there) Feels like doing the same with the pw admin tree, doesn't it?
-
Revisiting this old thread to feature Fargo. This is a really nice online outliner that can be used also as a CMS. Amazing! Edit: just to put it in context for those that don't know what a outliner is. A outliner is a software that let's you organize info (thoughts, notes, to do's, text, whatever you want) in indented lists. Great examples besides Fargo are WorkFlowy and moo.do. Of course, these don't include a CMS