Jump to content

Soma

Moderators
  • Posts

    6,808
  • Joined

  • Last visited

  • Days Won

    159

Everything posted by Soma

  1. Soma

    Checkbox

    This is not implemented like this in PW. Either make a checkbox for each option and put them in a fieldset... or, use pages for creating the options that can then be selected in your page using page reference field and a multiple select inputfield. check this thread: http://processwire.com/talk/index.php/topic,359.0.html
  2. Ryan, thanks for your time. I'm glad you like it. No I don't mind, that would be cool if you could implement something like this, as you said it's already there just not suitable yet for image type fields. Tell me if you need any help or suggestions/ideas. I could imagine something along the lines of a "fieldname[0,30]" to specifiy thumb width? Or a seperate config setting to specify it somewhere.
  3. Hi lesliec I'm not sure about other parts, but especially the hierachical page tree list in the admin uses json since it's ajax driven. I don't think there's an easy workaround for this.
  4. Thanks Ryan, but that must be a long dinner...
  5. Hey since I'm porting a site to PW2.1 I were thinking about what could help my mom managing her online art gallery. The current gallery is custom coded, and had a table list view approach where one would see thumbs of the images. This helps to recognize the image without open the entry. Since PW doesn't support this (yet), I thought that it may be cool to have the possibility of a label of type image in the page tree. I went to look for simple a solution and hacked the ProcessPageList Module to check for a custom label of string "image", then getting the image and return a img tag. Although I had to comment out the strip_tags and htmlspecialchars that's done before added to the label string (I think they can be configured to allow <img>... ). But it seems to work pretty well and sorting still works well. I'm sure there's a better solution and this is just sort of a proof of concept. Ryan, would of course know how to implement this far more convenient (possible to make a module for this, Ryan?) may with some additional configurations for thumb size etc. May this whole thing will be obsolete once Ryan implements a raster table view alternative for page navigation... (thought I've read it somewhere that it's planed) then thumbs would be much easier to handle. Here's a screenshot: with a little more styling: Here's where I modified the code a little: <?php foreach($fields as $field) { if(strpos($field, ".")) { list($field, $subfield) = explode(".", $field); } else $subfield = ''; // modified this part if($field == 'image') $v = '<img style="display:inline;" src="'.$page->image->size(0,30)->url.'"/>'; else $v = $page->get($field); ?> I would love to hear some thoughts on this subject. OT: Apart from that I think I spotted a problem with the page tree drag and drop sorting... Unfortunately it isn't possible to move pages around in a paged sublevel. Like moving from page to page. Are there any thoughts made on this issue? EDIT: Just found the "more" link at the bottom of the paged list, which makes it possible to... not very obvious but possible, and manual sorting on very large lists is anyway silly
  6. Thanks Ryan for the additional infos. Yes, I also used strtotime to convert the dates to a timestamp in my case. You're right, ip, use_agent and created_users_id aren't needed, just wanted to list them here for completion. BTW: I tried to change a comments text from within the page in the backend, and it doesn't save it. Is that a bug or intetional.
  7. May someone else finds this helpful. I wanted to create comments (using built-in comments fieldtype module) via API, as I needed this is for an easy migration from an existing site. I figured following does the job: <?php // get the page that you want to add comment(s), contains a "comment" fieldtype $p = $wire->pages->get("/guestbook/"); // create new Comment object $c = new Comment(); // fill the object with values $c->text = "Hello World!"; $c->cite = "John Average"; $c->created = time(); // timestamp, if you got to migrate a existing datetime you can convert using strtotime("2011-04-09 15:14:51") $c->email = "john@average.com"; $c->ip = "..."; // not needed (only for akismet) $c->user_agent = "..."; // not needed (only for akismet) $c->created_users_id = "..."; // not needed, automaticly set by pw // set status (Spam = -2; Pending = 0; Approved = 1; ) $c->status = 1; // add new comment object to the page "mycomments" field $p->mycomments->add = $c; // save page $p->save(); ?>
  8. Thanks Ryan for clarifying things. I just ran another search and found a post has already been made on this topic... http://processwire.com/talk/index.php/topic,401.0.html I think I forgot to add the additional save before adding pictures... I already knew as I figured that out from another post. Thanks for fixing the code. Something I came across when importing the image itself using: $p->image = "path/to/image.jpg"; I first had tried like you mentioned here: http://processwire.com/talk/index.php/topic,341.0.html But using external URL like http://domain.com/images/image.jpg didn't work. So I had to use local server path (document root).
  9. Just wanted to post it here for others that might look for an example. I'm currently working on importing a Site to PW2.1. Following code I figured is needed to create pages using the Bootstraped API: <?php include(./index.php) // bootstrap PW $p = new Page(); // create new page object $p->template = 'page'; // set template $p->parent = wire('pages')->get('/about/'); // set the parent $p->name = 'mynewpage_url'; // give it a name used in the url for the page $p->title = 'My New Page'; // set page title (not neccessary but recommended) // added by Ryan: save page in preparation for adding files (#1) $p->save(); // populate fields $p->image = 'path/to/image.jpg'; // populate a single image field (#2) $p->images->add('path/to/image1.jpg'); // add multiple to images field $p->save(); // testing echo 'id: '.$p->id.'<br/>'; echo 'path: '.$p->path; Note: in PW 3 with multi-instance support adding new Objects https://processwire.com/blog/posts/processwire-2.6.21-upgrades-comments-more-on-pw-3.x/#more-updates-on-processwire-3.0 [Edit by Ryan #1] Added first $p->save(); [Edit by Ryan #2] Changed $p->image('...') to $p->image = '...';
  10. Hi and welcome not sure if this is what you looking for: http://processwire.com/talk/index.php/topic,171.0.html
  11. How about the possibility to create a config for defining various image sizes? { "news_small" => "50,0,70", ([w,h,compr]) "news-big" => "700,0,70", "portfolio-small" => "50,50", "portfolio-medium" => "100,100", "portfolio-big" => "800,0,100" } So $image->original would be the uploaded raw picture, while you could use $image->thumb("portfolio-medium") ... which would be produced on demand. Don't know if it would fit in your concept, but just wanted to throw in my thoughts.
  12. lol I almost took this serious and thought wtf, until i clicked the link...
  13. for 1. Have you also set the ones in /wire/ also to 444?
  14. Hi there. I recently checked out Processwire and like it alot. I also wanted to come here and see what is planned for the support of multilanguage. Nice to see it's already considered. Also would like to offer my help for this. I could translate to german if needed. I think the most efficient way would be to have some sort of tanslation files (php, xml) that would make add other langauges easy. Thanks for creating this awesome product! Keep up the good work.
×
×
  • Create New...