-
Posts
7,529 -
Joined
-
Last visited
-
Days Won
160
Everything posted by kongondo
-
Updated first post to show module's API.
-
Update version 2: Added Tear Drop and Callout marker styles (thanks @heldercervantes and @trp respectively) Using unified markup for all the styles (<div><span></span></div>) CSS styles still needs quite some work, especially for the new styles (to fit into the unified markup) Circular Markers (default...for now) See screenshot in post #1 Tear Drop Markers Callout Markers
-
No, they don't have links atm. ps: Am moving the last conversations to the module's support forum to avoid confusion
-
@tpr, looking at your callout example, we could even have a choice to show 'marker title' instead of 'marker number' if user selects 'callout' for their marker style..
-
Alternatively, markup could be rendered to suit the CSS style, not the other way round Edit: I think that would be easier actually. So, if using 'callout' style, we use 'callout' HTML, if using 'Gmap/tear drop' style, we use its unique HTML and the same for 'circular'.
-
You won't have to. It remembers contexts: What you want is either #2 or #3 below: In view mode, if you haven't searched for any media, if you click on 'edit mode' button, you will be taken to edit screen for the media type you were viewing, with the first media selected to edit. So, if in view you were on 'all' menu, you will be taken to 'all' in edit. If you were on 'image' in view mode, you will be taken to 'image' on edit mode. If in view, you'd searched for media and got back some results, if you then clicked on 'edit mode' button, you would be taken to the edit screen for only those found items, shown one media at a time with pagination. If you got back only one result in the search, you would be taken to the edit screen of only that result (without pagination of course) If in view mode you click on the title of a media, you will be taken straight to its edit screen, no questions asked See example GIF below In any of the above scenarios, clicking the view mode button will display the media you'd just edited. Edit mode: clicking on title of media in 'view mode' - (#3 above)
-
Sorry guys...Couldn't do this earlier and could not implement the latest marker designs (callout and tear drop [gmap]). CSS gave me a lot of grief so I stopped. Would appreciate if either of you could work out if/how all three marker styles could be available but still allow marker positions to remain in place, thanks! Started a support forum here: https://processwire.com/talk/topic/11863-module-imagemarker-fieldtype-inputfield/
-
Fieldtype and Inputfield ImageMarker As of 02 January 2018 ProcessWire versions earlier than 3.x are not supported Version: Stable Project Page: Github Modules Directory: http://mods.pw/Bk OR http://modules.processwire.com/modules/fieldtype-image-marker/ Requires: ProcessWire 2.4 or greater ######################## About This module allows you to easily 'place markers' on an image. Each placed marker's position/coordinates (x and y) are saved in the field as well as the ID of the ProcessWire page the marker refers to. In the backend markers are placed on a specified base image. In the frontend, using each saved page ID you can then retrieve any information you want about the pages being referenced and display that on your website over the same base image you used in the backend. The module is useful for a diverse number of uses including: Product demonstration: place markers on various parts of your product to showcase its features. Using a bit of CSS and/or JavaScript you can create pop-up boxes displaying more information about that feature of the product. The information (in this case, feature), would be information you've stored in some field (e.g. a text field) in the page marker (i.e. the page being referenced by the coordinates). Office locations: place markers on a map showing global offices of a multinational company Points-of-Interest: place markers showing points of interest on a map or location or anything. The coordinates are saved as percentages. This means they will scale well with the image being marked. This module came about as a result of this request. @credits Ryan Cramer: This code borrows from his FieldtypeEvents. @credits Helder Cervantes: Module concept, HTML, CSS, JavaScript. @credits Roland Toth: CSS, Inspiration. API In the frontend, the field returns an array of ImageMarker objects. Each of these has the following properties info (integer): The page ID of the marker (i.e. the page being referenced by the marker. Using this, you can get the referenced page and have access to all its data. infoLabel (String): The title of the page (above) referenced by the marker (runtime only). x (Integer): The x-coordinate of the marker (%). y (Integer): The y-coordinate of the marker (%). You grab the properties as in any other PW field, e.g. $out = '<img src="'. $page->base_image->url . '" alt="">';// image to place markers on 'base_image' is the name of the file field foreach ($page->marker as $m) { // do something with the following properties $m->id;// e.g. $pages->get((int) $m->id); $m->x; $m->y; $m->infoLabel; } // the CSS and HTML are up to you but see InputfieldImageMarker.module for examples Frontend implementation is left to you the developer/designer
- 86 replies
-
- 18
-
-
-
Video clip showing latest development...(note: previews of other types other than images are still a work in progress...)
-
Not sure what's going on with my previous post. I've deleted it...Will update with short video instead...
-
Sorry I got delayed with other stuff + sluggish coming off the holidays ...I'll put something up tonight or tomorrow morning....
-
Show a field in admin only if the page you are editing has children
kongondo replied to cb2004's topic in General Support
All About ProcessWire Hooks http://processwire.com/api/hooks/ -
Yeah, that . Wanted to recommend that you look at the ProcessWire docs as well but figured out you are doing that already
-
Hi @flydev Welcome to ProcessWire and the forums and thanks for using Blog. If all you want is to show the titles, there's no need to call the module itself. The posts are normal ProcessWire pages, so adapting your code like below should work. <div class="col-sm-4"> <h3>Recents</h3> <?php $out ='<ul>'; //$blog = $modules->get('MarkupBlog');// no need for this line //$posts = $pages->find("template=blog-post, limit=5, sort=-blog_date");// if you want to sort by date $posts = $pages->find("template=blog-post, limit=5"); foreach ($posts as $post) { //var_dump($post); $out .= '<li><a href="' . $post->url . '">' . $post->title . '</a></li>'; } $out .= '</ul>'; echo $out; ?> </div>
-
Happy one to you too! Good stuff!
-
Show off . Here It's a mild 11°C with almost 25 mph wind Happy new year!
-
I doubt auto loading of resources will work with extending WireData Many modules (including Blog, Padloper, etc) are actually several modules bundled together, each fulfilling their specific role. So, that's OK, if you want to go that route. The important thing is to indicate which module requires which one and which one installs which one (if you wish, i.e., otherwise user installs each on its own). There's is no magic in respect of getting any module's config other than using what PW already provides: $anyModuleConfigs = wire('modules')->getModuleConfigData('AnyModuleClassName'); You can call that from anywhere, including in template files. It returns an array. It will be empty if there is no config data. https://processwire.com/talk/topic/648-storing-module-config-using-api/?p=5241 https://processwire.com/talk/topic/3343-how-can-i-setget-module-data-from-db-when-not-implementing-configurablemodule/?p=33087
-
What @Martijn said....but I'll attempt a guess If you are talking about a HTML class to add to your uploaded images (uploaded in a page edit session) to target with your CSS, ProcessWire doesn't output markup so you will have to add those on your own at runtime, e.g. $out = ''; if(count($page->images)) { foreach($page->images as $image) $out.= '<img src="' . $image->url . '" class="myImageClass">'; } echo $out; If you are talking about images you insert in the RTE, you can use the RTE to add your classes Welcome to PW and the forums
-
http://modules.processwire.com/modules/process-hanna-code/ I am guessing your HC exists on the page with ID 1187? So it will always evaluate to true. Use wire('page') to refer to pages originating the request.
-
It will only auto-load if in your module's init method you call parent::init(); then your code after that. The other conditions have to be true as well, i.e. the resources have to be in the same directory as the module and they have to be named as: MyModuleName.module MyModuleName.js MyModuleName.css What class is your module extending? I don't think the above works with all module types
-
What's the scoop on Repeaters. Should I be cautious?
kongondo replied to douglas81's topic in General Support
Have a read here: http://processwire.com/api/fieldtypes/repeaters/ And this post: https://processwire.com/talk/topic/4442-pw-performance-with-hundreds-of-fields/?p=43643 -
What's the scoop on Repeaters. Should I be cautious?
kongondo replied to douglas81's topic in General Support
Not quite.... Nope. Not really.... The most important thing to remember about repeaters is that behind the scenes, they are actually real pages (see /admin/repeaters). Not unlike the recommendation to be cautious with $page->children, if you have too many repeaters (and especially with lots of fields), you will be loading all of them into memory when you call the repeater. With $page->children, you can at least do $page->children('limit=20'); So, the issue is about memory/efficiency. Nothing to do with MySQL (which can easily handle millions of rows - of course, we don't load all of these into memory at once ). In conclusion, repeaters do not scale infinitely... -
What @elabx said
-
Sorted! Just add a value attribute $myModuleConfigs = wire('modules')->getModuleConfigData('YourModuleClassName'); $savedPageID= (int) $myModuleConfigs['selected'];// name of our input above (see my previous code => $p) $parentAdd->attr('value', $savedPageID);// (int) Saved paged ID #$parentAdd->value = $savedPageID;// alternative way to set For completeness, here's the full working code $form = new InputfieldWrapper(); $parentId = wire('pages')->get('/')->id; // pagelistselects $parentAdd = wire('modules')->get('InputfieldPageListSelect'); $parentAdd->label = __('Parent Page'); $parentAdd->attr('name+id', 'selected'); $parentAdd->set('parent_id', $parentId); $parentAdd->set('startLabel', __('Parent Page')); $data = wire('modules')->getModuleConfigData('YourModuleClassName'); $savedPageID = (int) $data['selected'];// name of our input above $parentAdd->attr('value', $savedPageID);// (int) Saved paged ID #$parentAdd->value = $savedPageID;// alternative way to set $form->add($parentAdd);