-
Posts
6,798 -
Joined
-
Last visited
-
Days Won
158
Everything posted by Soma
-
Creating modules for basic field-template-template file set up
Soma replied to Joss's topic in Module/Plugin Development
Check this http://processwire.com/talk/topic/1051-adding-and-assigning-fields-without-using-gui/ -
Maybe because you don't have "span" inside valid_elements?
-
There's font size capability in TinyMCE. I'm not sure I understand.
-
Add the "style" attribute to the valid_elements table. Now you can set the width and it stays. TinyMCE converts the width="100%" to a style="width:100%", and since PW default config has "style" not in valid elements it gets stripped. Ryan, can could you add that "style" to the table elements or default @[id|class]? -- BTW you can also define classes to use with the table and I also always use the excellent html templates feature of TinyMCE to create various prepared tables that has the right settings to just fill in.
-
Philipp Urlich @somartist https://www.facebook.com/philipp.urlich
-
Accessing a particular instance of a repeater field
Soma replied to thetuningspoon's topic in General Support
What id, and from where you got it? If you got the repeater id (which is a page behind the scenes) you just do. echo $pages->get($id)->myfield; -
Why not just add a hidden field to the form with the path or id of the page. <input type="hidden" name="refpageid" value="<?php echo $page->id?>"/> Then use $p = $pages->get((int) $input->post->refpageid);
-
The path can also be used to get a page. Find doesn't work or make much sense with url fields I think. $p = $pages->get("/url/to/page/"); if($p->id) echo "found: $p->id $p->title"; Url would be from the root and without protocol. I don't know what you're trying. Are you using Boostrap index.php? Also not sure why HTTP_REFERER.
-
echo $wire->pages->find("author~=Sam Smith") Doing echo on a page array, this will output id's separated with a pipe. This is using a toString method that is for convenience if you use the result in a other selector it will get inserted as string as 1929|1293|1231. Which is handy. Otherwise it will be a page array you can further use. For example: $found = $wire->pages->find("somefield*=anyword"); $result = $wire->pages->find("selected_authors=$found"); Which will result behind the scenes as something like this: $result = $wire->pages->find("selected_authors=1928|1233|1234"); Where selected_pages would be a page field for example. If you just really need the count of a find you can also just use count instead. $count = $pages->count("authors*=John"); Which is more efficient than a find.
-
->getTotal() not .getTotal().
-
If you want you can create a bootstrap, or in a template, and use API to change all TinyMCE fields settings. Example: include('./index.php'); $fields = wire("fields")->find("name*=tinymce_"); foreach($fields as $field) { $field->theme_advanced_buttons3 = "table|bold"; $field->custom = "theme:advanced"; $field->thirdparty = "bramus: /site/tinymce/bramus_cssextras"; $field->save(); }
-
Table name field should limit character length to avoid error
Soma replied to adrian's topic in Wishlist & Roadmap
It sounds to me like you create too much fields and dont reuse them. -
Just wonder how many tinymce fields you got? I isually need 2-3 max for a complex site. And theyre different in config anyway. If theyre not you're doing something wrong. Copy InputfieldTinyMCE would be possible but can be cumbersome as you need to maintain it for yourself. If its for thing like theme settings you can overwrite it in the admin template for all tinymces with a little js extending the config var.
-
If that would be true, all my development sites would be in google index, but they aren't.
-
Remove start=0.
-
Was that an echo?
-
You have to use wire in bootstrap. wire('users')->get().
-
See also this thread: http://processwire.com/talk/topic/1888-sublime-text-2-course/
-
Early stage InputfieldMailChimpCampaign
Soma replied to Martijn Geerts's topic in Module/Plugin Development
This is great Martijn! Interesting approach with using a fieldtype I never really thought of. As you've seen the other thread, I'm working also on a MailChimp integration myself. It was for a project of a friend who needed an newsletter and I first started creating some self brewn but abandoned it because handling of all the nice features and sending batch mails would get to tedious if not impossible at all. It's at best would have been only for really small amount of mailings. However I then decided to give MailChimp a try and changed the whole module to implement MC. It consists of a bunch of admin pages that gets setup when installing, where you can manage your campaigns and lists and select a page or enter a url for the newsletter to be used and the list. Then do test sends or final send. After sending you can see the stats of the campaign. So far it's working great but I planned to integrate, groups and segments too for creating campaigns which allows for using lists more flexible as you can't create new lists through API. My friend is using it now for a simple newsletter but I'm still working and reworking a lot of how it works and implement more features. I hope to share my module, but I think it's still not ready yet and takes some more time. I think why not have two different modules for allowing MailChimp in PW? It's great to see and have two different approaches and further we could share thoughts and experiences. I'm not sure we could stick together and go for a bigger project? Or what do you think? -
@pete you're good! YOU SPOILED IT!
-
This is something I think we need to find out at one point. Every now and then people try something which doesn't work, and suddenly it works. I have experienced this a couple times with PW, and was so far ignoring it. But I can swear, last time I did was the ColorPicker I updated, then I got something not working which I think should. Then after trying I added something in init like "$this->default;" and suddenly the default was avaiable. BUT then I removed this code and it was still working. Is it possible some cache in DB or PW that could give sometimes a wrong result or not working but then suddenly starts working?
-
Yeah and you can make them look the way you want. Of course for the female users, they're all male.
-
Custom Page field in user template won't fully change
Soma replied to adrian's topic in API & Templates
I can't reproduce. The only thing I can imagine is that you have (according your code) a "multiple pages" page type, but using a single "Select" as input? This can mess up thing if you changed those setting at one point of time. Try changing the inputtype to "ASMSelect" and look at what is there. If there's more than 1, delete them and change your page field to be only "single page" if you really only need single select. -
Suggestion for PW theme or future development
Soma replied to PHPSpert's topic in Wishlist & Roadmap
To build such tools is time consuming. And we all can't afford the time and energy and knowledge, like you too, to build them. Also it's nothing to do with admin theme per se, as those workflow and bulk editing things wouldn't be able to be build solely there. It would have to be built by modules. And I create already quite a lot of helper modules and theme that help out a lot and has improved my working with PW alot already. Ajax editing isn't possible within PW, as there's fields that need a lot more than just content (TinyMCE, Page etc) and need additional script and configurations. At least it isn't something easy. @raydale. But I have something else for you which is fun http://processwire.com/talk/topic/2380-fancy-admin-mode/ :) Regarding workflow and bulk editing. I see many possibilities creating custom edit modules and I think time will come where these appear (as my WIP). It's just we all haven't got the time needed to do everything within the short amount of time PW is out. Also I don't see all this workflows and bulk editing everybody requests as something that important, as you can easily open 2-3 tabs and do that without going back and forth clicking in the menus, and I know other (Ryan) also works this way. So having a flow that allows to edit everything from everything wouldn't be much of a time saver as I see it. Further the API can be used to create a lot of pages or field or templates quickly. DAMN STUPID FORUM SOFTWARE!!! It's getting worse and worse.... sorry -
There's some issues with floated elements in widget content (already mentioned this couple times) 1. I have two floated buttons and I need to hack the container to be able to avoid collapsing. 2. When floating the inputfield buttons, the margin on the button is adding and you see the background color when hovering, instead the margin should be on the wrapping <a>. So simply doing this in my css to float the buttons #MC_NewsletterPreview div a { float: left; } And get this: Instead I have to do this to fix both issues with it, which is not really nice. Overflow hidden on container is a solution I would avoid. #MC_NewsletterPreview div a { float: left; margin: 0 1em 0 0; /* add margin */ } #MC_NewsletterPreview .ui-widget-content .ui-button{ margin: 0 0 0 0; /* fix hover background color issue */ } #MC_NewsletterPreview .ui-widget-content{ overflow: hidden; /* fix floated content issue */ } To get this #id's Last but not least. When I have a inputfield "title" it adds an #title id to it. But the admin page when editing a page has already a #title for the page title above form. This should be changed to something like "#pw_title" to avoid issues. Stupid me, I just have to set a different ID, forgot it's not set by PW but by my code. So not a real problem just something to keep in mind.