-
Posts
6,798 -
Joined
-
Last visited
-
Days Won
158
Everything posted by Soma
-
Well, sorry wasn't sure as I didn't try. Had a quick look again, and "path" isn't returning the subfolder. It's the "url" method that is calling "path" and is appending the root, which would be the subfolder. Since "url" isn't hookable you could either: 1. Use $page->path in all your templates 2. Modify the config->root to not add the subfolder. So Instead of the replacement do only: $this->config->urls->root = "/"; in the hook. 3. Wait for Ryan. Not sure what will break, since you're excluding the hard subfolder path.
-
Not sure I understand. Since there's quite a couple ways to make multilanguage sites, one would need to know how you're using multilanguage, what is the setup, any modules you're using.... Generally PW doesn't automatic add language segments to your urls (depending on what you use). Not sure what's about "hidden" pages you experience. You only see unpublished pages in the frontend when logged in as superuser. "view", do you mean the button when editing a page? Usual multi-language setup PW does only know the default url of a page, and loads that when clicking "view". So you would have to add /en/ manually when loading the page, or click on your language switch to see other languages. -- PS: Since PW multi-language implementation is meant for the backend primarily, it does lack some multi-language features for frontend that is not covered. That's why the most flexible and recommended setup is to use separate page tree's to create multi-language websites.
-
SInce you have it in a subfolder PW will include it in url generated for pages. To modify the url PW spits out you could create a simple module to the Page:path This will work for also links in tinymce and $page->url would spit out the right url in your case, so no code changes in your templates. Although you could. A module like the HelloWorld.module can be taken and add this stuff. The module is autoload so will always replace the path, backend and frontend. In the init add a hook: public function init(){ $this->addHookAfter('Page::path', $this, 'replacePath'); } In add a method replacePath: public function replacePath(HookEvent $event) { // url generated by PW $old = $event->return; // strip out the subfolder $new = str_replace("/annemieboer.nl", "", $old); // return new path $event->return = $new; } Install it and see if it works as it should everywhere. Tinymce links, page fields and selects.
-
Possibility to login user through API without knowing password
Soma replied to apeisa's topic in Wishlist & Roadmap
How about a module that copies the user and sets a random passwd and logs in. -
solved Search in multilanguage site with multilang fields
Soma replied to seddass's topic in Multi-Language Support
Well what multilanguage setup are you using there? Any modules? Well the language switch links are already right. How are you generating the url on them or also on the navigation?- 15 replies
-
solved Search in multilanguage site with multilang fields
Soma replied to seddass's topic in Multi-Language Support
When switching to language en, the search form is not changing it's action url. <form id='search_form' action='/pesquisa/' method='get'> <input type='text' name='q' id='search_query' value='' /> <button type='submit' id='search_submit'>Search</button> </form> When I manually enter http://maran.pt/en/search/?q=locker it seems to work.- 15 replies
-
- 1
-
There's no select where you can define option in PW. I think you're referring to the select module by Hani: Please post reports and issues there. Thanks.
-
Adding the rendered markup to the form will not be different from the Sorry, just have to get that right. An inputfield prerendered and added to the form will actually work as in my example. Not sure now what's with that it won't get processed as Ryan mention, because it obviously does work. The value get's saved and populated as it is also the module itself taking care of it. The module provided the inputs and only itself know how to handle/save it and not the form. But I get how this limits future modifications of the Inputfield as it's already rendered. And while having a need for additional markup that can't be done by a Inputfield there's the InptufieldMarkup. Or to make it again modular, there's only the way of having it be new Inputfield again that can be used. I think I got learned a lot just from this thread again, good times!
-
Module HelperFieldLinks - field and template edit shortcuts
Soma replied to Soma's topic in Modules/Plugins
Wooot? Hehe, this module was one of my first helpers. Couldn't without it and I think it saved me hours already. -
I understand what you mean, but I don't think you'll ever need it and makes no sense to create another module hook to change the icon select. Even with your method I don't think is any different. As I said I understand, and it certain cases this might be desired, but not here. However then you'll find ProcessWire maybe "not right" because it uses this technique in many cases. Even the buidlForm of ProcessTemplate has rendered markup in there added to the form.
-
That's fine. Glad you figured it out. Just wanted to mention an alternative we usually use is we create some default config array to use in a module, then merge it with the saved in getModuleConfigInputfields(). static protected $defaults = array( 'myicon' => "hello.jpg" ); Then in the config method. static public function getModuleConfigInputfields(array $data) { $data = array_merge(self::$defaults, $data); ... And you could use that default config in the module if nothing else is defined yet.
-
Why shouldn't it work? I just use the InputfieldMarkup to create the "wrapper" fieldset and then I add "rendered" markup to it ie. the select inputfield. I removed the label from the select inputfield because the label is now defined by the IntpufieldMarkup. It's how we do this in PW and nothing special here. So first prepare the InputfieldSelect and add the output to it. Later add the icons container markup to it and add the markup to the form. $icon = $this->modules->get('InputfieldSelect'); $icon->addOption(''); $icon->attr('id+name', 'badge_icon'); $icon->attr('value', $template->badge_icon); $icon->addOptions($icons); $markup = $this->modules->get('InputfieldMarkup'); $markup->label = $this->_('Page Icon'); $markup->value = $icon->render(); // add markup of the select input field ... add more to it I can't follow why you do this but it's up to you. I don't think an extra intpufield is needed inside this module, if, it should be separate inputfield. However I don't really care as I got my own PageListIcon module which I will use, as your module doesn't work on most of my clients hosting.
-
Can you do a var_dump on $page->prevNext And what type is the value you get from $nextUrl? Can you try without setting it to page and just use the $nextUrl and not $page->?
-
To come back to this. What I do is this: $markup = $this->modules->get('InputfieldMarkup'); $markup->label = $this->_('Page Icon'); $markup->value = $icon->render(); $markup->value .= '<div id="template-badge-icons">'; foreach ($icons as $_icon => $name) { $markup->value .= '<img title="'.htmlspecialchars($name).'" src="'.$icons_url.$_icon.'" data-icon="'.$_icon.'" />'; } $markup->value .= '</div>'; if (file_exists($icons_license)) { $markup->value .= file_get_contents($icons_license); } $t->add($label); $t->add($color); $t->add($markup); And you get your desired output A fieldset with the select and the icons inside it.
-
We're nearing 12/2012 so expect unusual things happening everywhere.
-
Open template, remove guest role... configure. Tadaa, key icon show for pages using that template. Must have dreamed or confused with my current icons Ok, just now reading again this post I have previously missed the fork link. Was too tired reading stuff. Will check out later. Yeah, any dependency should be left out from both sides if possible. I think my solution of preventing the icons output by adding a check in the theme to see if the you page list icon module is installed or not, would be a good and easy one. Simply add a CSS file or not. Well "system" templates is actually one "admin" template for all admin pages. So no. Maybe a different solution would be possible there, but I see none. Yes you can, use ___install().
-
Well I give up. That's exactly what I was trying to pull out of you! Without knowing/seeing your exact template setup I can't tell or help.
-
I have a normal page. In the template php file for that page I have this: include("head.inc"); $page->layout = "text.php"; $page->myvar = "myvar1"; if($page->layout){ include("./markup/{$page->layout}"); echo "included..."; } include("foot.inc"); And in the included php I have echo $page->myvar; echo $page->body; All works fine and I don't see anything rendered or executed (whatever that means) twice. So I can't reproduce it.
-
No there aren't. $page->myvar = "hello"; echo $page->myvar; But I don't know what is has to do with what you experience. What I believe maybe (although can't say for sure as I don't see enough code) is that you have a main template that "renders" then include another page which renders again. So PW "renders" 2 times. If you would hook on "Page::render" it will get outputted twice.
-
Well I don't think anybody can reproduce and give an answer to what you're saying without knowing what exactly you're doing, since there's possibly a million ways to build your templates.
-
Does that tell you the xdebug?
-
language translation in templates stopped working
Soma replied to Soma's topic in Multi-Language Support
The only way I can get it to work would be: if(is_null($textdomain)) { if(defined('DEBUG_BACKTRACE_IGNORE_ARGS')) $traces = @debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); else $traces = @debug_backtrace(); -
language translation in templates stopped working
Soma replied to Soma's topic in Multi-Language Support
Thanks Ryan. I get this Textdomain: site Edit: When I do it removing argument of the debug_backtrace() function I get: Textdomain: /var/www/web8/web/site/templates/views/order-form2.inc -
language translation in templates stopped working
Soma replied to Soma's topic in Multi-Language Support
Ok tried again and it works when I do: if(is_null($textdomain)) { $traces = @debug_backtrace(); ...