-
Posts
6,798 -
Joined
-
Last visited
-
Days Won
158
Everything posted by Soma
-
Module HelperFieldLinks - field and template edit shortcuts
Soma replied to Soma's topic in Modules/Plugins
Just updated to 1.0.3 with some fix and new feature. fixed issue with template edit link added support for repeater fields http://modules.processwire.com/modules/helper-field-links/ -
getting current $page in a Inputfield or Fieldtype module
Soma replied to Martijn Geerts's topic in Module/Plugin Development
This is a perfect way and I think the only one, even ProcessPageEdit uses it. If you output in your module $this->page you'll get the id of the admin page and not the edited one. So the GET id is there to know what page. I think there's other way to get to the page but it will end in the same call somewhere anyway. To check process your on in admin try $this->process and you'll get ProcessPageEdit as it's the process module running. So get the page and set it to the inpufield module with $this->page = $this->pages->get($this->input->get->id); Is simple enough and will always work in this context. Then use it as usual if(!$this->page->editable()){...} -
Ah now, my local XAMPP has symlink to htdocs. Using wire('config')->paths->root it works. But doing this doesn't. wire("config")->paths->templates = wire("config")->paths->root; $somepage = wire("pages")->get("/about/what/"); echo $somepage->render(); But setting the paths->templates in config.php does work even with $_SEVER['DOCUMENT_ROOT']. $config->paths->templates = $_SERVER['DOCUMENT_ROOT'] . "/";
-
So you mean this should work? $home = wire("pages")->get("/about/what/"); $home->template->filename = $_SERVER['DOCUMENT_ROOT'] . "/basic-page.php"; echo $home->render();
-
You'll laugh but there's been such cases where people do swap prices in a shop and get away with it.
-
That's what I've tried in all variants and it doesn't work for some reason. $somepage->template->filename = '/path/to/file.php'; doesn't get recognized in a bootstrap.
-
Haha, yes in this case not a real problem maybe. But I see it rather as the "most stupid thing" to create and publish such a script to the not so aware folks out there in the first place. Which obviously has a security problem and will be used by common "have no idea" users. And I'm not sure about what the laws are if a user can order a thing for 0.01 and you at the end have to deliver it for that price.
-
Yeah, when you use LanguageLocalizedURL module you should mentioned that as it makes it quite different. The page find method works, but maybe you'd need to set the parent path correctly. Glad you figured.
-
Have you tried using find? $products = $page->find("parent=/produtos/, limit=3"); Or is there any other page->find with limit happening in your templates? This could inteferer with this and should use "start=0" in selector I think.
-
Theres no need for curly brackets for variables. And I don't understand the question. What does not work?
- 5 replies
-
- search form
- select
-
(and 1 more)
Tagged with:
-
Welcome pcreact I'm not sure why you want to do this, but I did a quick test and I also can't get it to overwrite after a bootstrap. It seems the config after bootstrap is somehow not recognized when rendering a page after that and already set to the system. I tried with a hook or set the template file before rendering but couldn't get it to work. But I am sure there's something I'm missing.
-
I changed my code above example: It's not needed to each them just: $("#menu span:empty").remove();
-
If your doing the opposite you better just do this: array ('item_tpl' => '<a href="{url}"><span class="nav_extra_title">{nav_extra_title}</span>{title}</a>') Then use this to hide empty spans $("#menu span:empty").remove(); I'm not sure, but most commonly you execute the script before dom even loaded. So if the script is like this in the header it will never work. A technique is to execute it after dom load. $(document).ready(function(){ // your code }); Or short method $(function(){ // your code }); Otherwise I don't know.
-
Hmm, took me 2 seconds to hack it, and enter my own price... which then get's submitted to paypal. Not a solution I would take serious.
-
Rally nice what you have done to the blog profile, hardly recognize it
-
It's not possible to do conditional markup generation. So you're maybe better off building you're menu with your own code. Which is quite simple. Only workaround I see is using JS to generate it. array('item_tpl' => '<a href="{url}" data-extratitle="{extra_title}">{title}</a>') Then use jquery. $('#menu a[data-extratitle!=""]').each(function(){ $(this).prepend($("<span class='nav_extra_title'>"+$(this).data('extratitle')+"</span>")); });
-
But then it will be visible until you check it and save it again...
-
Theres a like button by the way ;-)
-
Thats why i sugested the checkbox. Or you can add a check in your menu code with $page->viewable(). That should ommit pages with no template file.
-
A page with no template also is not viewable and has no publish mechanismus. If you want to still have that you could add a publish checkbox and use that in queries assuming you have the data somewhere output. Otherwise you could give it a template for that matter.
-
Repeater shouldn't be excessively used and nested. It's not built for that use and will likely cause some problems. I thougth Ryan decided to put a restriction already to prevent nested repeaters. Anyhow there seems to be a function going nested wild and is limited per some setting on server or php I think.
-
Delete the entry in the modules table and you should be fine.
-
It seems all profiles that are exported and installed this way suffer from this problem. You have to create the folders manually. I already created a new profile using the latest PW and the issue remains. Maybe Ryan knows more about and how it could be fixed. So it's not a problem of this profile but the Profile Exporter and how it all works. So I can't really do anything to fix it. It's not possible to give permissions to folders that are in the repository.
-
Anyone having trouble with Email Obfuscator in 2.2.9?
Soma replied to CliffG's topic in Modules/Plugins
Glad we figured it out and learned something. Now have a jump into the cool water it's nice in here. -
Anyone having trouble with Email Obfuscator in 2.2.9?
Soma replied to CliffG's topic in Modules/Plugins
No problem. Just thought it would be helpful to know when dealing with JS and building websites. prettyPrint is not defined. prettyPrint() is a function that it says is not defined. Looking at the kickstarter https://github.com/joshuagatcke/HTML-KickStart/tree/master/js I don't see the prettify.js included in your website.