-
Posts
6,808 -
Joined
-
Last visited
-
Days Won
159
Everything posted by Soma
-
'the guest role is required' error when saving new user
Soma replied to diogo's topic in Wishlist & Roadmap
Yes it does if you remove the disabled... -
'the guest role is required' error when saving new user
Soma replied to diogo's topic in Wishlist & Roadmap
This does work: $("#Inputfield_roles_37").prop({ checked: "checked", disabled: "disabled" }); -
Hi Peter I don't know really how hard a hard lock in a soft lock module is. The reason to only have a soft lock is clear, and hard locks can get a burden if someone lock a page by having the page open. I think it's possible, but have to think about some time. It would be as you suggest and option you need to enable. But then also the Module name doesn't fit anymore.
-
PW can handle x thousands of pages easily. Image Manager is using ajax based data table to list and search/filter those pages, so it scales infinitely. Also the abstraction of the images in texts uses page ID's searches, and this is pretty fast. So you could go as far as your server limit. It's not more intensive than PW itself. ImagesManager doesn't add a noticeable overhead. You could use this for all images, but still also use the on page image field where it makes sense. However when sharing images and inserting those in Textareas, I think ImagesManager approach and its abstract feature is a big plus in handling those. It's still alpha and it's possible some things may change on the way to a first RC. So it's not for use in production yet.
-
Thanks guys! Yes there I see some room for improvements to select the tag and also show some infos of the image size. It's impossible to have image field select from those images. It would require a new image fueldtype. But that's not something that has to be connected to ImagesManager but just a field you can select an image page. Thats the great thing about this approach. But you can do it with a page field easily. I'm doing it. If you use PageListSelect you'll even see the image thumb. And it would also be possible to select multiple or even just categories. This is even better than a dedicated fieldtype.
-
Image management concerns: Is ProcessWire suitable for me?
Soma replied to Grays's topic in Getting Started
@Grays sorry it took so long, but I was up to something that might solve some problems with sharing images. I create ImagesManager for these cases where you have lots of images shared on different pages. If you're still into the boat this might be interesting. http://processwire.com/talk/topic/3219-images-manager-alpha/ -
PW Images Manager (beta) Just a weird little screencast trying to show how it works. (out of date a little, tags now use a textfield for easy copy/paste) This module allows you to manage images from one central repository. You create a root page "/images/" where you can then add categories and images as pages. From there the new admin page created "ImagesManager" will show categories and images added in a ajax data table, from where you can see and search/filter all images, upload and create new categories and edit images too. Every image will also show an image tag generated to copy into a textarea. This tag looks like this: {image=/path/to/image/imagename/, width=200}The width=100 is the thumbnail size used to output the image.You can also have additional segment to contain classes: {image=/path/to/image/imagename/, width=100, class=align_left}Or you can enter the id directly: {image=1033, width=100}Once inserted into a textarea field it will get parsed when saved and loaded automaticly. It will store an abstract id tag in Database and convert it back to the image HTML tag. So after first save you'll see the image inserted in a Wysiwyg and be able to resize and place it as usual. Once it's inserted somewhere Images Manager will show a search link with the pages containing the image (you can configure the fields int the module setting). You can change the image or move it to a different category, it will still work and show the correct image. This also works with multi-language fields.You can still also use the regular insert image dialog in TinyMCE and chose image from those pages. And it will start keeping track of those as well (they're the same after all). You can use those central images pages also with page fields to reference them single or even whole categories, search them with API and do what you like. Images Manager will also parse the page render on front-end and replace any found image tags with the HTML code. It will also look for a description on the image and output it as alt tag. If you want to have multi-language description you can add a `image_description` TextLanguage field to the image page template and have images parser use them. Along with this module, you can also install the `PageListImageLabel` module to add thumbnails to the image pages in the tree. To get it working you need to have the basic setup: 1. Create new `image` field with input setting to 1 max image 2. Create new `image` template and add `title` and the `image` field created before 3. Create a 'image-category' template with only title and allow the `image` template and `image-category` as child pages under family settings. 4. Create a `image-root` template with only the title field for the root of the images tree. Allow only `image-category` as child page under family settings. 5. Create the root page with the `image-root` under the home page as "/images/" 6. Done. The structure of the image repository looks like this /images/ /cagetory1/ /imagesxy/ /category2/ /image2/ /image3/ Now you can use the ImagesManager to add categories and images. But you can also still use the page tree to add new stuff as usual. The root path, template names and fields are configurable in the module settings. How to install the module: - Download the contents of this repository and put the folder renamed as "ImagesManager" into your site/modules/ folder - Login in to ProcessWire and got to Modules page and click "Check for new modules". You should see a note that the two new module were found. Install the "ImagesManager" module. - A new admin page "ImagesManager" should appear in the top menu. - You may configure the option on the module screen to suit your needs. Download at github https://github.com/somatonic/ImagesManager Thanks and enjoy.
- 72 replies
-
- 31
-
-
Image management concerns: Is ProcessWire suitable for me?
Soma replied to Grays's topic in Getting Started
If you let me know a little more about how these images are gonna used on the pages I could help provide a image system thats gonna work. I.e. Do you need to insert images in the body text inline. Or will they have a predefined place. Will they be just single images or galleries? -
Add rel="nofollow" when adding a TinyMCE link
Soma replied to formmailer's topic in Wishlist & Roadmap
@RJay Here the step to get it working. You need to enable two plugins and add the "rel" attribute to the valid elements in TinyMCE. You can edit the configuration of TinyMCE on the field settings under the tab "Input". There's a collapsed fieldset TinyMCE Advanced Configuration Options. Add the two plugin contextmenu and advlink to the plugins text field: ...,contextmenu,advlink Then in the field valid_elements add rel to the @[id|class] so it won't get stripped off: @[id|class|rel] Now when you have done that you go edit your text and add a link using the PW link dialog. Then click on the link using context menu (right click) and select "Insert/Edit link". You'l be presented with a ton of attributes you can set to the link. But you need to also add them to the valid_elements first. -
When I install the new module I get this Error: Using $this when not in object context (line 641 of /Applications/XAMPP/xamppfiles/htdocs/pwmultilang/wire/modules/LanguageSupport/LanguageSupportPageNames.module) PW still works but when open the module in admin I get this error. I use it on a new install and my local xampp has php 5.2.9
-
Such great news! Thanks Ryan this is awesome. For the moment I have to test a little more and think about what could be added. But it' seems its all there that makes a great help to making multilanguage sites.
-
Edit: Wanted to add something I forgot. You can also enable davanced mode (config.php) and you'll have a select underneath the fieldgroup on the template edit screen to select a Fieldgroup from another Template. It will reference the fieldgroup of that template and and stay connected that if you change the original it will reflect on the template that share the same fieldgroup. This could also be used (instead of cloning) to have different templates having same data type but have a different name thus a different template file. BTW the whole admin backend is done using one template 'admin' using processes you define on a admin page to tell what functionality or controller it has.
-
"Template" inPW is like a db table with all its fields. If you change the structure of the table you loose data... Except for fields that are the same in the template you change to. Changing a template of a page is not something you do all the time and only to give this page a different content or meaning. It's all about data here and not presentation. "Template File" is more of what you think of in MODX I think, and it's linked to the Template by it's filename. But you don't have to create a file for a template unless you want or need to have it renderable or viewable. The Template name also can be changed, thus mapping it to a different template file. As WillyC pointed out you can also leave the name (which often is used in template code as indentifier and you don't want to change that, unless developing) and define a alternative name that will be used to map to a template file. You can even have all your template share the same template file simply by setting this. A page using a template to build it's data model also isn't locked in to a certain presentation. You can change your presentation template on runtime or have some MVC like approach even. You could even build a simple system to be able to select from different "presentation modes" on a page using page field to build a selection. You make it up. There's many possibilities with how Template and Template Files work together and it allows for some great flexibility in a simple manner. I even after some time working with PW I found ways I didn't see or knew it was possible before, so enjoy the ride. Not sure this is of any help. Always struggle a little explaining this stuff.
-
How do i setup a File upload with InputfieldFile
Soma replied to Harmster's topic in API & Templates
You screenshot is gone... I think you have to use $modules->get("InputfieldFile") to load an instance and not new InputfieldFile() See example form here https://gist.github.com/somatonic/5236008 There's also various threads about form and API. -
Yeah this should work. I figured out how you could add a image and get resized with the InputfieldImage you have. Having this as setting $field->maxWidth = 100; $field->maxHeight = 100; Then when adding the image to page field: // create new page image first $img = new PageImage($uploadpage->images, $upload_path . $file); // add it to page as usual $uploadpage->images->add($img); // trigger the image max size sizing $form->get("images")->fileAdded($img);
-
I think if you set the max with and height on the image field you have on the page you won't have to resize it. Larger images will get resized when attached to it. Of course you can resize the image via API using ImageSizer.
-
Ahh, if you use the InputfieldImage/-File to upload it won't be like a field you have on a page, you only have the Inputfield and use it to "upload" files. In this case it's not doing anything because those particular actions are triggered when an image is added to a page. So since you add the image to a page at the end, you'd have to set the max size there of course. Once you add it to the page it will resize. Or you could do it using API after submit and before you attach the image to a page image.
-
InputfieldFile isnt neccessarely an image. Youd have to take InputfieldImage.
-
Create your own profile and use that as a start?
-
Arent they the ready to edit repeaters?
-
Create Pages (with File-Upload Field) via API
Soma replied to MatthewSchenker's topic in API & Templates
Maybe remove the code in the first post and link to a working code at least.- 84 replies
-
- 1
-
-
- forms
- image upload
-
(and 1 more)
Tagged with:
-
Create Pages (with File-Upload Field) via API
Soma replied to MatthewSchenker's topic in API & Templates
I posted 3 or was it 4 examples codes that work already, so what is the deal ? Spent lots of hours btw...- 84 replies
-
- 1
-
-
- forms
- image upload
-
(and 1 more)
Tagged with:
-
Why? You could add those, but they're not gonna do anything as you can't and don't search with <> anyway. Adding the words works just fine. BTW when I search with "<keyword" you land in nowhere land, throwing a selector error. Ryan bug? Even tho using $sanitizer->selectorValue("<keyword") the < get's through and throws a fatal error. Edit: Hm happend in 2.2.9 installs, it seems to work correct in later versions.
-
Thanks diogo, I know something like this is possible, just not a solution I like and think it the way to go especially on big sites. Also just stripping tags would leave you with connected words where usually a white space should be etc. After testing a little I found %= operator has very strange results, it returns pages that don't contain the word at all. While when doing a search in mysql admin with %word% on body it returns only 2 pages, while using pages find it returns 4. No idea what is going on but definately something wrong there. Now looking a PW db query the ~= operator would be the one to choose anyway, as it searches multiple words and actually uses the stopwords compared to all other operators. So adding stopwords is also easy and I have now added some additional words for certain html tags. $stopwords = array("table","tbody","thead","tfoot","height","strong","align","href","style","left"); foreach($stopwords as $w) DatabaseStopwords::add($w);