-
Posts
6,808 -
Joined
-
Last visited
-
Days Won
159
Everything posted by Soma
-
Ryan, I think it's best if you copy it from my repo. If you don't mind. Since you also would need to implement something to allow external content.css. How about templates for tinymce? Also would you also suggest it still being the prefered way to copy it to the site modules folder for extra advanced tweaking? Or would you see it possible to connect some more to be able to put in site folder, like additional plugins, templates? I could imagine having more advanced config possible to for example put in the js config code into a field or the like? What would be the way to go? As you know we already went this far with the topic, and I ended up copying it to site modules folder. Yeah you're right about the core, I just always assume everthing in "wire" is core. Though looking closely it's kinda bundled into the distribution.
-
Glad you like it. I think there isn't any downsides, at least none I can think of now (im using it in a couple projects now). Only thing I would question is, if we include it in the core, the content.css is also there. But anyway it would be possible to allow having a content.css in the site folder for easy tweaking. As is it something that has nothing to do with PW and just sits on top of it, one could question why it is in the core anyway. Speaking for myself, it's always the first thing I do since a few projects already, move that module to the site folder, so I have full control, without touching the core. But for sure it would be excellent to have a better implementation of it in the core. Can you upload files?
-
Ok since I still can't upload files here, I just created a repo. https://github.com/s...ldMyTinyMCE-PW2 here's the plugin used http://www.bram.us/p...amus_cssextras/ I forgot I updated it already with the version Ryan put in PW. There's a content.css which I used for a project, so feel free to change it to your needs. Basicly you can use it to style the look of what you have in the body in the RT to look like on the frontend (fonts, colors, styles), just put them carefully into your content.css. Only html selectors like a.myclass, td.mytdclass get's parsed, so you can use ".myclass" to style without getting added to the select. And only if an "a" is selected the dropdown gets acitvated and show's the class. Oh and you can also do the same with #ids. There's also a template setup included, in the "tinymce-templates" folder are the html files you can select using the "template" button (just need to add it to the config, as it's not in by default). They are then also added to the config in the js with path and name/description.
-
I spent a lot of time looking for a solution to styles select in tinyMCE. I ended up using bramus css extras, as it allows for inherit and dom element dependent styles. So from infos, he states that it fixes problems with the tinyMCE default styles select only allowing anchor styles and some other weird behaviors. So his plugin enables to do things like li::ul[ yourclass ], so if you have selected a li it will put the class on the parent ul. Also it only shows styles that are allowed for the current selected dom element. It also can be set up to so it parses the .css file automaticly. When I started playing around with it in PW I ended up copying the tinyMCE inputfield into my site folder and rename it. So I could easily setup whatever I want without touching the core. Since then I use it this way. It was still using the older version before Ryan updated it, so I'm not sure if it is any different now, but I doubt. I can if you want attach my modified version, so you could try and go from there. I'll just have to clean it a bit. BTW I also recognized a strange behavior with the configuration "theme_advanced_buttonsX", I had to add 'theme_advanced_buttons3 :""' to get a 2cond menu bar working. I wasn't working straight away. Just forgot completely about it.
-
Glad I could help. TO my understanding, it wasn't working cause you check for "hover" event in the live method, and then e.type will never return "mouseenter". It's unlike the .hover method which binds mouseenter,mouseleave. Dunno why exactly it is like this, but I guess it should work all well. I haven't tried but maybe it would require to write .live("mouseenter mouseleave", function ... ) { if (e.type=="mouseenter") .. to make it work with those events.
-
I've checked this one out on my local PW2.2 isntall. I get the same problem with the hover not working. I fixed that one by changing the InputfieldCropImage.js a little. The live hover event wasn't working. I changed it from "mouseenter" to "mouseover", and it's working now. I'm not sure about github. I have the repo local and commited the fix just now, but I don't know if it gets commited or apeisa needs to pull the commit first... So heres the code for those interested: $(document).ready(function() { $("a.crop").live("hover", function(e) { if( e.type === 'mouseover') { url = $(this).data('thumburl') + "?timestamp=" + new Date().getTime(); $(this).append("<img style='position: absolute; z-index: 999;' src="+url+" />"); } else { $(this).find("img").remove(); } }); $(".InputfieldCropImage .InputfieldFileList").live('AjaxUploadDone', function() { console.log("it should"); $("a.InputfieldFileLink", $(this)).fancybox(); }); /* Modal disabled, cropping huge images is very difficult with modals $("a.crop").live("click", function() { var url = $(this).attr('href'); var windowHeight = $(window).height() - 120; var windowWidth = $(window).width() - 120; $iframe = $('<iframe id="pwimage_iframe" width="100%" frameborder="0" src="'+url+'"></iframe>'); $iframe.parent().css('position', 'fixed').end().dialog({ title: "Crop Image", height: windowHeight, width: windowWidth, position: [60, 60], modal: true, overlay: { opacity: 0.7, background: "black" } }).width(windowWidth).height(windowHeight); return false; }); */ });
-
@apeisa, yeah that sounds like a good approach. I like the idea. And the shop cart module is already there, just needs some tweaking and maybe some more options. I think a plan would be helpful to list what we got and how it could work out, in other words a project plan? Or really look closer into what is needed as a base to help build a shop (cart module?) and build up different modules around it that add functionality independent, so one could pick what he likes and add to the project with a module. So with a PW install everybody has access, we could build up some default shop to try it out and everyone can contribute, export a profil (fork, github?) and try it out on local server if wanted. @jbroussia, you're right it's strange, something I didn't recognized until now. Seems it is something done on domain name server routing that ignores it. Or could be even on browser level. Not sure.
-
Current version you can see the dev site here : http://dev.bag-shop.ch. Here you can see a product with color variations http://dev.bag-shop.ch./de/kollektion/taschen/paula/ . I will provide a profil export once I got the time maybe next week. I think the "problem" regarding product options and variation is not a simple one, once you need to do colors, different sizes with own prices, and even more options per product. But certainly not impossible, though it could get tricky. Maybe just not as nice to handle those in the admin, as it may could be with custom fields, repeatable fields, or even custom page types. But since PW is still evolving in this area, I think it may best to wait a little to have more options available. For instance the repeatable fields could then be used for variations. But my best guess would be that the way it will be implemented is by using invisible subpages anyway, so it's hard to tell right now how this could be used. I'm also very unsure about how far such a PW shop module should go and provide all the necessary functions and options a full blown shop system should have. There's certainly a lot of things that come together. For example things like stocks, multilanguage, reduced prices, shipping costs depending on total prices etc. customer management and so on... I'm also not very experience in full blown shop, as I really just coded 2 very simple shops for customers before, that didn't needed any of those features. Also the shop module in our CMS was only able with a little trick to create variations with different prices per product, but provides an interface and API for them and its much like repeatable elements. I'm not sure how more complex variation could be handled but certainly there's a point where it might needs some additional coding in the core or shop module. I don't know any of the avaiable ecommerce software out there but I also haven't heard much good from some of them, so I guess it also hard to go with that route and chose among the ones out there anyway. I love to have a flexible CMS/CMF that allows easy coding and freedom, so many of the features can be done in some way or another. Maybe we should look for what is the most needed features for simple shop setups, and allow simple extending by using PW style 100%. I mean only provide the essential core functions a shop needs. So an more experiences site builder can easily setup something. But if someone wants to go for a complete out of the box shop module, I certainly don't want to stop them. Certainly something for people that don't have the ability to do advanced coding.
-
I don't understand exactly how it could get messy, but maybe you're right. No I didn't encounter any errors, just added as function to get total items in cart. And I removed all of the cart, checkout form, add to cart markup genrating functions, as I don't really need them. And I added some more fields to the installer for the order template. Also as mentioned I added simple variation price check in the add to cart functions, was pretty easy and I think you've done a great job. I agree there could be some sort of markuup generation tools in there, but then it should be configurable or still one still being able to completely code their own in the templates. It is the case for another CMS we use at work that has a great sho module already built in. And it has no markup generation functions at all only helpers and method for adding, updating, removing from cart and saving the orders for use in the orders management. Edit: Oh and I thought the logic you got together with the markup genrating function, to add and render the checkout process was very hard to track and understand with all the post/get vars starting from the entry point in the renderCheckout function. That's what I simplyfied a lot by having some logic of it in the template. That way I'm not bound to it and can make the process of the ckeckout the way I need it.
-
I'm currently setting up a simple shop, using the module apeisa started. It had to go quickly, so I had no time to wait for further progression on this. But I wanted to share my experience these days with you guys. It is really a simple shop with products that have color variations. The payment method will be credit cards using a external service (little like paypal). Since they have already an order management, it doesn't even need the orders management apeisa started implementing, but it will be good to additionally save orders in PW. As for the variations I created sub pages on the product, so I changed the cart functions to look for if the variation has a price, else it takes the price from the parent. The cart saving feature in the custom module table is great, but I doesn't need address, so only session id and the serialized cart will suffice. And the saving order using a template with the needed fields isn't touched but in my case it does need a lot more fields than apeisa started with. So the gender, address, city, country can be entered. As for the module to keep it flexible, I think it is best to leave out all hard coded "html" and "forms" generation of the module code. So I have the sc-checkout template all the logic of the process. So I'm able to code the shopping cart the way I need it, and just request the items array using the public module function. I didn't even used the renderAddToCart like function to generate the "add to cart" form fo a product, as it is simple to code a form to my needs and just have the product id in there, and the action url to the cart page. So only really function to handle the cart are necessary. I'll be glad to help with this module, and I'll share the project once it's done next week.
-
Might be what he looking for after reading again. That will look for pages with the "images" field populated.
-
It's hard to understand what exactly you want to do. Can you also try to put some spaces between your words? Thx. You can grab an image using the image field name. If its setting is to allow only a single image file you can do: // single image field echo $pageobject->imagefield->url; echo $pageobject->imagefield->size(100,100)->url; If the image field is set to allow multiple images, you must use a loop to cycle through them, or chose the first, or maybe a random one. // multiple foreach($page->imagesfield as $img){ $thumb = $img->size(100,100)->url; echo "<img src='$thumb' />"; } // or chose first from image array $page->imagesfield->first->url; // or random $page->imagesfield->getRandom(1)->url; // grab pages using a special template and output a list of their images. $pa = $pages->find("template=yourtemplate"); echo "<ul>"; foreach($pa as $p){ $thumb = $p->imagefield->width(100)->url; echo "<li><img src='$thumb'/></li>"; } echo "</ul>"; Does that help you? If not can you provide better and more information what you want to do?
-
Translation in templates using language module
Soma replied to Soma's topic in Multi-Language Support
Ah ok, thanks Ryan, now it works this way. Just got some OT question. 1. When installed there's the default language, which is english. When I create a new language let's say german I would name it "de" so I can use it for front-end translation and user/guest language as the url segment /de/somepage. I most of the time use it like this and in the page tree I create /de/ and /en/ for the language pages. Now I recognized that I can't change the name "default" to like "en". Edit: Damn! What was I thinking... meh... thinking more about it , it makes sense to have "default" as a constant, as otherwise one wouldn't be able to know what the default language name would be . And for using it in a multilang setup it's just a matter of checking for "default" and set the language path segement to "de" or "en" as the global front end lang var. 2. And another one is I just question myself, what do I do when I want to specify german as default? Ok I guess I can drop the german language json package into the default. And then? Create an english language package for the english version? -
I'm trying to get the a translation to work in the search result template. I got this: $searchresult_out .= sprintf(_n("Found %d page matching your query:", "Found %d pages matching your query:", $searchresult_count), $searchresult_count); And it doesn't show up in the translation edit page. Any ideas?
-
I think I found it. When I remove the "template=product" it works. but it only lists the direct childs of the parent. So kinda same issue as with the other problem before. Not big deal, as I can just use the "template=", but I would expect it to look through all pages below the parent not just direct childrens. If that's really the problem. Edit: I would work with the php custom code "return $pages->get("/produkte/")->find("template=product");" that's what I kinda thought it would do with the custom selector string option when using parent. But guess I'm wrong. Edit: I also thought using a parent would be more performant when going with a parent instead to search through all pages. It's also dependent on my setup why I ran into it. Produkte is like /produkte/ ---/category1/ ------/product1/ ------/product2/ ---/category2/ ------/product3/ ---/category3/ ------/product4/ ------/product5/ ...
-
@apeisa, not much except that I like it fancy seriously I like the bar item it adds with a trash icon, opposed to having a simple dropdown. I always thought it is more clear to the unexperienced user, but it may be more personal preference. @Ryan, I still can't get it to work. I have same setting as you, I checked various options, it doesn't matter if single or multiple or what select input type.. strange. Whenever I remove the parent in the custom selector it works. ?
-
Thanks for the fix. Yes as i mentioned im using asm select. Nothing special else. Does it work for you? It even shows an example there... using same selector, but cant get it to work. Im also have it set to single page.
-
Now trying other options. WIth the new "custom selector" option. I enter "parent=/produkte/, template=product" there and no pages show up in the ASM select. When I change it to "template=product" it works. The parent page /produkte/ is hidden. But even with "include=all" it doesn't work. Guess it must be another problem.
-
I'm using latest PW 2.2 I experience a problem with the page field. When I define a page as the parent like /produkte/, and as select type I chose PageListSelect. No other options. Then on page where this field is, I go and select a page from the tree, after saving page it isn't there anymore. I figured that it happens only when I select a page further down. If I select a page from the direct child of the parent it works. A bug? /produkte/ --- /page1/ (works) --- /page2/ (works) ------ /page2a/ (doesn't work) --- /page3/
-
What if I have a dashboard I want to list pages the user has access and are unpublished? Edit: Ah, is check_access checking only for if a page is "viewable" or not by the current user? So it doesn't check if a page is editable? I got it working in my dashboard "unpublished pages" widget to list all pages and I'm additionally checking in the foreach loop if the page is editable and output it with a link or not. But drawback is that I can't use pagination or limit=10 with this technique when I don't output the not editable pages in the loop. Is there any solution to this problem?
-
That's really great to have the arguments by name and not position! Thanks Ryan for the update. But I'm not quite getting the last one. Maybe a little example could make it more clear?
-
apeisa is right, I just checked my dashboard module. i'm getting old as for acces, isn't the "check_access=1" what you mean, to only include accessable pages?
-
I'm not getting what exactly you want to archive with published or not. Every page ist published or not. There isn't more. Are you trying to check if it exists or not? Edit: ah there's no "published" I think, only "unpublished" so try "status!=unpublished, status=unpublished"
-
Autocomplete and Other Search Enhancements
Soma replied to Michael Murphy's topic in Getting Started
You're right Ryan, sorry, using the "parent" does only show the part. I think I was mixing up something. Yes it was when using template restriction. As mentioned it would be cool to have pages "disabled" that aren't allowed to be selected to avoid the problem. As for the autocomplete with a new inputfield type, I was thinking of a way to extract the "name" information using a site map list as a string, to then compare. Or maybe something with using get/find on the "name" and then successively complete one url segment after another, just a shame that it doesn't work with fulltext index searches, as it would be much easier. But maybe I'm going to far, and it isn't really something needed that. -
Autocomplete and Other Search Enhancements
Soma replied to Michael Murphy's topic in Getting Started
Thanks Ryan, but I think you kinda missunderstood what I was trying to say. But that's my fault, because I struggle to explain it clearly. I was just trying to explain where I'm coming from that I think autocomplete for paths could be useful. But this gets complicated with all those terms we use and lots of options... apart from that I struggle to get the point clear. But your explanations may help understand a little more. I didn't knew for example that the "name" field only works with "=" and not "*=". I think something along your second route would be possible, but I guess a special inputfield would be required to search for paths using strpos and finds and the like. Anyway. For the first part: Yes that's the setup I ended with, when trying your new AC module, "path" as label and searching on "title". I think this work also nicely. Secon part: BUT my point was, that in the one project I had to chose the asm multiple select along with the "path" as label and then using a custom code to pull pages from the download section pages. (Pretty nice option there!), but when setting it up, I would have really liked to use the "PageListSelectMultiple" input type for that. So they can browse for the download pages. Don't get me wrong this "works", but my point was that it isn't hiding pages from the tree that aren't allowed to be selected. If I for example define a template or a "parent", it still will let me select a page that isn't allowed in the first place (as reported some time ago already). It just isn't well to allow page to be selected from the tree, when it isn't allowed, but it gets added to the list and stays there until I save page, then it is removed from the selected pages. If you still don't know what I'm talking about, I'll record you a video showing it.