-
Posts
10,902 -
Joined
-
Last visited
-
Days Won
349
Everything posted by adrian
-
Have you seen these posts: https://processwire.com/talk/topic/7441-using-git-instead-of-ftp-in-shared-hostings/ https://processwire.com/talk/topic/2885-what-filesfolders-should-be-added-to-gitignore-for-regular-development/ https://processwire.com/talk/topic/5417-using-git-with-a-cms-for-version-control-and-deployment-on-multiple-machines/ Might get you started.
-
There is a bug in the current stable that is causing your problem trying to install TinyMCE. It was fixed in the dev version 8 days ago: https://github.com/ryancramerdesign/ProcessWire/commit/68acd61f7327ad4529fe15b25f388c6dc49ae38d If you don't want to run dev, I think you could probably just make those changes shown in the above commit that are in the wire/core/Modules.php file. As for the hidden pages showing up in your page field - there is a note with the custom PHP code that says: " NOTE: Not compatible with PageListSelect or Autocomplete input field types." Not sure if there is an easy way to not show hidden pages. I am in a rush, but I think you might need a little helper module to remove them from the list. Maybe someone has time now, otherwise I'll try tomorrow.
-
All PW variables (incl. $page) are not available inside modules, or functions in templates. You need wire('page')->editable() etc, or often in modules, depending on the context you can use $this->page, but wire('page') always works.
-
How to change output markup of images added by editor
adrian replied to Juergen's topic in General Support
I think this module from Martijn will do what you are looking for: http://modules.processwire.com/modules/textformatter-image-interceptor/ -
Hey Ivan - if I am becoming an expert on character encoding, then we should all be very scared - I still have no clue But anyway, I have committed a fix which seems to work fine now in some limited tests. Can you please take a look and let me know.
-
@hellomoto, I don't really think there is a security risk, especially given that you can limit this module's actions to specific templates and pages if you wish. Anyway, hope it works as you expect!
-
Module: Video embed for YouTube/Vimeo (TextformatterVideoEmbed)
adrian replied to ryan's topic in Modules/Plugins
The other option would be to change the regex in the module. This is what I use in Get Video Thumbs and it works fine with plain text (URL) and Textarea fields: /\s*(?:http(?:s)?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(??:watch)?\?(?:.*&)?v(?:i)?=|(?:embed|v|vi|user)\/))([^\?#&\"'<>]+)/ That said, I agree with Martijn's approach -
Actually, if I use $event->object, I get "Method Pages::of does not exist or is not callable in this context" But it works fine for me with: $event->arguments[0]
-
Change existing installation to "blank" profile
adrian replied to Robin S's topic in Getting Started
Good point about my admin user account showing up and also the admin url being wrong - sorry about that - it really was meant to be a fun option - I didn't think it through fully I am going to remove the attachment from the above post so I don't confuse anyone else. The install process really is very simple, so glad you're heading that route. -
Can you show us the full code for the module that you are using now. The code chunk I posted works if used with the rest of the module that Phillip posted. i am not completely sure it does what you want, but it definitely does what it is supposed to do
-
I think Phillip inadvertantly forgot the actual save part Try this: public function saveShortUrl($event) { $page = $event->arguments[0]; //#todo Rename to your field names. $page->domain = parse_url($page->source_url,PHP_URL_HOST); //#todo Maybe some more error handling. $page->of(false); $page->save("domain"); $this->message("Save the domain {$page->domain}."); } As Phillip mentions - you need to have a field called "domain", or rename both instances of "domain" in the code above. Hope that helps.
-
That "-is" suffix is a fairly new addition to PW I think. horst is the one who can explain it properly, so I might defer to him, unless someone else knows anything more about it.
-
Great minds "almost" think alike: https://processwire.com/talk/topic/7274-are-there-better-fields-naming-convention/?p=70106 Similar suggestion, but for adding fields to templates.
- 1 reply
-
- 1
-
- admin theme
- menu
-
(and 1 more)
Tagged with:
-
Ok, I should have just looked at the source for that function in the first place This is what you need: $image = $event->object->getPageimage(); $width = (int) $this->input->get->width; $height = (int) $this->input->get->height;
-
I think it must be something in your sizeCloud method, because my quick testing with the ProcessPageEditImageSelect::executeResize hook seems to be working fine. Sorry about pointing you to the wrong function by the way. It is to do with your: $resizedImage = $image->size($width, $height, $options); Which means that $image is not the object you are looking for. Let me go on my way - to investigate a little more
-
Hey @mike131 - this is a duplicate post - no need - we'll find you Please lets all stick to this one: https://processwire.com/talk/topic/8491-admin-controller-what-file-is-it-calling/
-
Is this what you are looking for? https://github.com/ryancramerdesign/ProcessWire/blob/dev/wire/core/ImageSizer.php#L281
-
Page fields are about as core as anything in PW. PW without free Page fields would be unspeakable
-
You need to get the URL from the field: $slide->slide_link_url->url; But to make things a little less confusing, I would rename your field from slide_link_url to slide_page or something like that By the way - I am not sure why this is in the Profields board - do you mind if I move it to general support or API? PS Soma - I edited my mistake before your reply came through - wasn't trying to hide my initial mess
-
I would say you need two fields, one for internal PW pages - use a Page field with Deref in API set to: Single page (Page) or empty page (NullPage) when none selected and Inputfieldtype set to PageListSelect+ You can set the Parent of Selectable Pages to Home or any subbranch. For the external URL option, use the URL fieldtype so your editors can manually enter a URL. Then in your template code, check which one has a value and use that for the link. You may want to add a showif dependency so that as soon as one field has been populated, the other one is hidden.
-
Actually, I take that back - having "None" selected is a valid option as you can choose to output the components manually. For now, all you need to do is save the module config settings page once and the errors will go away, but I will fix the module so this is not necessary - should have it done pretty quickly. EDIT: Updated version of module just committed now saves default config settings during installation.
-
The problem is that you haven't selected a "Phone Output Format" in the module config settings. The module needs this to know how you want it formatted. Do that and the errors will go away ! That said, I should probably handle this better
-
Yeah, that's what I thought That's not how this works. You need to create a dedicated template for the login form. Perhaps called: loginform.php This template should only contain the framework of your site, eg the header and footer, like in the example, or however you like to structure things, along with $loginForm where you want it to appear. This loginform.php template will be called instead of basic-page.php, home.php, etc if the page is protected and the person needs to login. Does that make more sense now?
-
Sorry you're having trouble. All I can think is that you are trying to add it to a template that is not selected under the "Login Template" option in the config settings for this module. Are you trying to add it to an existing PW template file like home.php ? The way this works is that the module uses the selected "Login Template" instead of the template that is normally used by a page. Does that make sense / solve your problem?
-
Change existing installation to "blank" profile
adrian replied to Robin S's topic in Getting Started
For the fun of it, I have another solution for you. Firstly, install Migrator via the zip Then extract the contents of the attached file into the assets folder. You should end up with a structure that looks like: assets/migratorbackups/blank-profile Then go to Setup > Migrator > Restore and choose the blank-profile option from the select - it will be the only option available. That should be it. Let me know if that works out for you.