-
Posts
11,258 -
Joined
-
Last visited
-
Days Won
374
Everything posted by adrian
-
Here's another bit of code from Ryan that might prove helpful: http://processwire.com/talk/topic/3299-ability-to-define-convention-for-image-and-file-upload-names/?p=32623 It is not for random filenames, but it does show how to set up a file renaming module
-
It really is personal preference, but I think Ryan would most likely go with the first: Here are a couple of relevant threads/posts: http://processwire.com/talk/topic/4439-when-do-we-need-curly-brackets/ http://processwire.com/talk/topic/3835-sorting-pages-by-multiple-values/?p=37797
-
Replace: src:'assets/img/overlay.png' with: src:$page->bgimage->url EDIT: horst has it right - I wasn't awake apparently
-
In the selector: $newsposts = wire("pages")->find("parent=/news-articles/, $category, template=TUT_news, limit=3"); you should just need to add: sort=-created eg: $newsposts = wire("pages")->find("parent=/news-articles/, $category, template=TUT_news, limit=3, sort=-created"); That will sort your posts in reverse order (-) of created date/time.
-
Hey Martijn, I just sent you a pull request to add the ability to specify the maximum filesize for an image once inserted in an RTE. I needed this functionality because clients were uploading very high resolution images and embedding those - nasty! Training only works for some people and only some of the time The interceptor will automatically compress this image until it reaches the limit specified in the module settings. If the limit is set too low, it can obviously result in some poor quality images. I wonder if it would be good to have a bit of a sliding scale for this setting based on the physical dimensions that the image is going to be displayed at. Let me know what you think and definitely feel free to ignore, or give me your ideas for a different approach. I am also open to making this a separate module if you'd prefer.
-
Ah, sorry - been on 5.4 for so long I forgot about this. Yes, repeaters aren't supported yet. For the moment I'll add that to the list of fieldtypes to ignore so at least there won't be an error. Btw, the last update also now handles RTE links that have been processed by the PageLinkAbstractor module. EDIT: Committed version with those small fixes. NB that the check to ignore repeaters is currently only on the export, so you would need to export again to check.
-
Is this of any help: http://modules.processwire.com/modules/process-page-clone/ Could you store all the snapshot versions (copied with the clone module) in an "archives" parent. Also, if you haven't seen it, is this also any use: http://modules.processwire.com/modules/version-control-for-text-fields/
-
diogo - thanks for spotting that - I misread what he wanted and forgot that unpublished is the default. As for the error - not really sure why that isn't working. Not really advisable, but you could hack the module code: https://github.com/ryancramerdesign/FormTemplateProcessor/blob/master/FormTemplateProcessor.module#L202 Comment out that highlighted line.
-
$form->addStatus(Page::statusUnpublished);
-
I think you can probably replace: $form->parent = $page; with: $form->parent = $page->parent;
-
Looks like you got it sorted! At least they are both working for me. Thought I'd mention this, just in case it's an issue at your end - you never know sometimes
-
This is a recurring issue for those new to PW. Your images field is by default set to handle more than one image, so you can either change it to only support one image, or you need to define which image from the field you want to display: if($page->themeimage) echo "<img src='{$page->themeimage->first()->url}'>"; Or replace first() with last() or eq(n) where n is the number of the image in the order, starting with 0. To change the image field to only support one image, go to the field's details tab and change Maximum files allowed to: 1
-
All these avatar changes are freaking me out I am starting to see vxda's point. I was caught up on embedding into RTEs and then display through templates, but I can see the scenario where it would be great to have a client be able to insert an existing image from another page into a dedicated image field.
-
This is in the works: http://processwire.com/talk/topic/3219-images-manager-alpha/
-
But why do you need to upload them multiple times? You can access them from any page, either through the RTE example above, or using the API to display them in your templates like: $pages->get("name-of-other-page-with-image")->image-field-name->url That assumes the images field is set to only handle one image. If it contains more than one, you would need: $pages->get("name-of-other-page-with-image")->image-field-name->first()->url or instead of first(), you could choose last() or eq(n) where n is the number of the image in the field based on their order.
-
From: https://github.com/evanmcd/SublimeProcessWireSnippetsAdvanced If you're using Git, the best method is to clone this repository to your ST Packages folder. (on Mac, it's here: /Users/your_username/Library/Application Support/Sublime Text 2/Packages/). You can also download the zip file and unzip into the Packages folder. Either way, I would recommend creating a ProcessWire subfolder as there are more than 200 files.
-
Just a wild guess - do you think it is possible that they have messed with the .htaccess file or have some other redirect rules (maybe even in the apache conf file) that would be causing the redirect?
-
If you are referring to using them in an RTE, then to expand on Kongondo's comment, when you are in the Insert Image dialog, click the "Images on Page" header and click the "change" link to browse for images on another page.
-
Hey Antti, I have just committed an update that I think fixes the multi-language issues. I know there are two different ways to do different language versions of a field, but from my understanding, this should work with both. Would you mind checking on your end and see if the import is now working for you. Thanks!
-
I am no Github expert, but the only way I have ever been able to submit a pull request is to fork the full repo. This seems to confirm this: http://stackoverflow.com/questions/14821583/pull-request-without-forking However maybe I am not exactly understanding what you mean by "Or can I do this only with the files which need the changes?"
-
I am not sure about that error in the context of field creation - perhaps you can share what went wrong. Generally not good practice as it can get you in trouble if you don't know what you are doing, but you may need to fire up PHPMyAdmin and delete the "field_fieldname" table and also the relevant row from the "fields" table.
-
Module: Video embed for YouTube/Vimeo (TextformatterVideoEmbed)
adrian replied to ryan's topic in Modules/Plugins
Glad you got it working. The $videoItem->video makes me think you are storing the URL for the video in a dedicated field? If that's the case, you shouldn't need to do that preg_replace. You already have the id from $my_array_of_vars['v'] so you should be able to just build the embed version directly from that. -
Module: Video embed for YouTube/Vimeo (TextformatterVideoEmbed)
adrian replied to ryan's topic in Modules/Plugins
Ok, so it sounds like you are manually adding the thumbnail image to an RTE? Maybe you don't really need the video embed module, because you don't actually want the video to play inside the RTE field? There are lots of ways to go about this. You could use a regex in your template. You could make your own module. You could maybe use the Hanna Code module (http://modules.processwire.com/modules/process-hanna-code/) and just enter the video ID and use that to output the thumbnail and link to open in fancybox. You could even use JS to modify the link. An example of your exact usage would really help to narrow down the best approach. -
Module: Video embed for YouTube/Vimeo (TextformatterVideoEmbed)
adrian replied to ryan's topic in Modules/Plugins
It depends on what you want to do exactly. Because the module converts a Youtube link that is in an RTE texatarea field, you already know the id of the video because it is in the link. You could easily insert the image link using the url schema from that first link I posted. Maybe if you can explain your usage scenario we can help more. Where you do want to display the image? How is it connected to the embedded link. It is easy to grab the id of the video from the link in either PHP or JS using a regex, but the video module also stores the id in the PW database (in the textformatter_video_embed table), so this might also be an option depending on your needs. EDIT: Here is the function in the module that parses the video url: https://github.com/ryancramerdesign/TextformatterVideoEmbed/blob/master/TextformatterVideoEmbed.module#L127 Or you can use: $url = "http://www.youtube.com/watch?v=C4kxS1ksqtw&feature=relate"; parse_str( parse_url( $url, PHP_URL_QUERY ), $my_array_of_vars ); echo $my_array_of_vars['v']; // Output: C4kxS1ksqtw -
Module: Video embed for YouTube/Vimeo (TextformatterVideoEmbed)
adrian replied to ryan's topic in Modules/Plugins
Hi vxda, Assume you are using youtube: http://stackoverflow.com/questions/2068344/how-to-get-thumbnail-of-youtube-video-link-using-youtube-api And here is some code for both youtube and vimeo: http://darcyclarke.me/development/get-image-for-youtube-or-vimeo-videos-from-url/