-
Posts
6,798 -
Joined
-
Last visited
-
Days Won
158
Everything posted by Soma
-
You could add an image field and hide it , so its invisible in the backgound. I woudnt worry too much about.
-
I added mcmorry to the author too.
-
Sorry, I was assuming, as you questioned not being able to do so, that you needed to do so. No that's cool I just misinterpreted what you were saying. One thing comes to mind, sometimes also knowing exactly what thing you're building, will often help finding alternative ways, maybe finding even better solutions. But if you're trying things out to see what's possible and where the limits are that's ok.
-
Cool, glad you found it out. Thanks for letting us know
-
I didn't really mean it, but I thought it's something I would search first and then ask if nothing found. And as I know there was such a thread already I wanted to search it as I know it can be hard to find things here sometimes. I also suggest to use google "site:processwire.com keyword" search as it will be much more successful.
-
Strange as the url http://localhost:888...re/news/?page=2 suggest that page numbers aren't enabled on template thus the GET version of it. If it's enabled it should be /page2 ... Edit: I'd guess you already have read the pager documentation ?
-
Thanks, but this isn't a module and it's not from soma (well I added the third-party config option to the TinyMCE field in PW). It's just to show how to use the advanced options to integrate a TinyMCE plugin from outside the core.
-
Have been testing a little and so far it works well.
-
Ok let me search that for you
-
And why you also want them to insert in the page body tinymce text? You could still use a "textimages" field or so underneath the tinmyce field so image could be uploaded there if really needed. Sounds from other posts, like you're trying to bend things a little while having all possible (queries, categories, repeaters) that is currently not there and repeaters are maybe an good option to be able to query them. I wouldn't consider repeaters designed for that use, but surely works (apart from not being accessible in a outside repeater text field or from other pages. Depends a little on what exactly we're dealing with here. Products catalogue, news articles, common content/infos? If it where really about meta infos and something like gettyimages, the one image as a page together with meta infos as much as needed would be the way to go. If for articles or news I would consider just using a images field for each category (summary, gallery, details) and upload them separate in a dedicated field. Maybe tradeoff reusablity some for easy, straight forward setup. I would consider giving function meaning by using many images fields, rather than a category select. Especially as in your case the category is "function" and not real meta info. Maybe it can be even mixed with some centralized image content that are pages with collections of images and you can add them to any page through page select field. I would carefully think it out what really matters. Also creatiing a new extended image field that has a pagefield might a good solution too. Works surely better for single image fields as it would for multiple, but in both cases you will always have to set the "category" everytime you replace or upload a new image. There's really a lot that can be considered regarding image management, but I never felt I needed more than there is. Not saying there could be more options for special cases in a image default field. Still maybe a module would be the way to go to give a needed functionality rather than using something that will may limit you later on.
-
How to troubleshoot: non-virtual folders returning PW 404?
Soma replied to MarcC's topic in General Support
Well, I have piwik installed on one PW site but I named the folder analytic. But I'm sure it should be possible to name it piwik. -
How to troubleshoot: non-virtual folders returning PW 404?
Soma replied to MarcC's topic in General Support
The problem might be that the home page template has url segments enabled? -
It's multi language domain translation function. Makes text in templates and modules and admin translateable. http://processwire.com/api/multi-language-support/
-
No its not possible. Kinda very special case. Well u could try making it max levels 3 and hide third level with css and open on click.
-
There's different approaches to how it can be archived. I'm building a shop with products with multiple categories possible. I'll quickly show how it's done. Create template "category" only with a title field. Then build a tree structure that will be hierachical and serve as the navigation. The template need to have urlsegments enabled. That will enable to display products under a category. So the url will be something like /shop/category1/product1/ and in another category the same product /shop/category2/product1/. This will make it easy to have a highlighted navigation. The product template will have fields you need and create them under one separate tree. In that template you add a page reference field "categories" that has set the categories tree parent as parent, and a multiple select to browse and select them. Then this following php code will handle the navigation and rendering of the products. This is in the template for the category template. $prod = null; $nav = $modules->get("MarkupSimpleNavigation"); /* * * If on shop category pages * All category pages use "shop" template * "shop" template has url segments and page numbers enabled * So urlSegment is always the first (1) when browsing the categories * Once the page is of type "product" we use that information to output details * * This most easy setup with navigation and categries nested unlimited * and multiple categories per products * */ if($input->urlSegment1){ // the page is a product? if($pages->get("name=$input->urlSegment1")->template == "product"){ $prod = $pages->get("name=$input->urlSegment1"); $current = $page; } else { // else we get current page $current = $pages->get("name=$input->urlSegment1"); } } else{ // in case we are on a "normal" page, do different stuff $current = $page; } $root = $page->rootParent(); echo "<div style='float:left;width:30%'>"; echo $nav->render(null,$current,$root); echo "</div>"; echo "<div style='float:left;width:68%;margin-left:2%'>"; // detail page if($prod){ echo "<h2>$prod->title</h2>"; echo "<p>$prod->body</p>"; } else { // list page $prods = $pages->find("template=product, categories=$current, sort=title"); foreach($prods as $p){ echo "<p><a href='$page->url$p->name'>$p->title</a></p>"; } } echo "</div>"; There's variations how this can be setup, but this gives a very easy and flexible setup, with a navigation that is highlighted and can have multiple categories for one product.
-
If you have the config field mentioned in TinyMCE field it should work in latest PW. Make sure you have entered and setup everything correct.
-
For more easier (without exploding head) sitemap generation take a look at the MarkupSimpleNavigation module. http://modules.processwire.com/modules/markup-simple-navigation/
-
Ok got it. I updated the code above, it produces valid nested ul and even some indentation. Don't even ask why it works, it just works. It's magic.
-
You're having a function in a function and some complexity not really needed here. This is the simplest way: function siteMap($page, $output='') { $output .= "\n\t<li><a href='{$page->url}'>{$page->title}</a>"; if($page->numChildren) { $output .= "\n\t\t<ul>"; foreach($page->children as $child) $output .= str_replace("\n", "\n\t\t", siteMap($child)); $output .= "\n\t\t</ul>"; } $output .= "\n\t</li>"; return $output; } $homepage = $pages->get("/"); $siteMap = siteMap($homepage); echo "<ul>".$siteMap."</ul>"; Edit: Screw it I got something wrong. Edit: updated to really work.
-
What have you defined in the content.css? It needs to have something in there to work. Like: p.lead {} Classes like: .lead{} won't work
-
Thanks Ryan for the module! Sooo many new things to test out I run out of time.
-
Not sure what you mean. It's context aware so without focusing a element in the text that actually has a class defined the dropdown is disabled. If it's not otherwise it's may a your browser.
-
Since a latest updates to TinyMCE inputfield there's an option to add custom plugins from outside the core to TinyMCE on a per field basis. Here's an example how to add the bramus_cssextras plugin. Ok download the plugin http://www.bram.us/p...xtras/#download 1. create a directory in your site folder i.e. "/site/tinymce" 2. create a plugins folder in it i.e. "/site/tinymce/plugins" 3. put the folder "bramus_cssextras" in there 4. put a content.css in the "tinymce" folder (this is where you can define classes or id's, like: p.lead {...}, ul.list {}, h2.red{ ... } ) (see bramus_cssextras homepage for further infos) 5. now go to the TinyMCE field you want to use it. Under tab "Input" you'll see a "TinyMCE Advanced Configuration Options" collapsed. Open it. 6. add the buttons to one of the theme_advanced_button fields: "bramus_cssextras_classes,bramus_cssextras_ids" if you don't need id's leave it out 7. add the content.css to the content_css field setting like: "/site/tinymce/content.css" 8. add plugin to "Third-party plugin" textarea field like: "bramus_cssextras: /site/tinymce/plugins/bramus_cssextras" as one line. Done. You should now be able to select the class "lead" when cursor inside a <p> tag. Add as much css classes or id's to the content.css as you wish, bramus_cssextras will autodetect them. Have fun.
-
Ok download the plugin http://www.bram.us/p...xtras/#download 1. create a directory in your site folder "tinymce" 2. create a folder in it "plugins" 3. put the folder "bramus_cssextras" in there 4. put a content.css in the "tinymce" folder (this is where you can define classes or id's, like: p.lead {...}, ul.list {}, h2.red{ ... } ) 5. now go to the tinymce field advanced settings 6. add the buttons to one of the button fields "bramus_cssextras_classes,bramus_cssextras_ids" if you don't need id's leave it out 7. add content.css to content_css field setting like "/site/tinymce/content.css" 8. add plugin to third party text field settings like "bramus_cssextras : /site/tinymce/plugins/bramus_cssextras" as one line Done. You should now be able to select a class "lead" when cursor inside a <p> tag. Have fun. I'll create a topic for that too so anyone looking for it can find it easier.
-
I'm officially confused. Not sure exactly how you're doing things but I feel it could be done differently. You want them to specify paragraphs but at the end don't want them to be there? Edit: Wrapping paragraphs in <p> is the usual and wanted behaviour. If you want be able to set styles to tags, take a look at the bramus_cssextras tinymce plugin that can be installed from outside, you could use the "third party" config to install it. This will allow you to define classes used explicitly by paragraphs or headings, something not really possible with default tinymce class select. Let me know if that would be something for you and I can lead you through installing it.