-
Posts
4,956 -
Joined
-
Last visited
-
Days Won
100
Everything posted by LostKobrakai
-
How to create a custom admin settings page?
LostKobrakai replied to madalin's topic in API & Templates
You could even hide potential "Children", "Settings" or "Delete" Tabs.- 21 replies
-
- admin
- admin theme
-
(and 1 more)
Tagged with:
-
If you're talking about the FormBuilder module, than you'd probably populate that value not via the url, but by adding the value to a hidden field in the form. That form-field would be created in the backend first and you could also use FormBuilder to read from it, like it's intended to be working with the email sending mechanism.
-
Page field, or similar, but for repeater rows?
LostKobrakai replied to a-ok's topic in General Support
You can actually select repeater pages by their template: $pages->find("template=repeater_fieldName"); -
RT @mims: Pretty damning indictment of Facebook's video strategy from a guy who makes his living on YouTube https://t.co/hhhhjIimKd
-
That's certainly possible, but how to do it depends on how you're creating these forms. Also you should keep security in mind, when building such a thing, as everyone can change and request an url of this type, but with totally different values.
-
Ah now I see your problem. You can simply use multiple pages to manage your segments. // home.php is most likely the startpoint for your single page website $children = $page->children; foreach($page->children as $child){ echo $child->render(); } // some-childs-template.php <div id="some-segment"> // Render the segment content </div>
-
#anchors are part of the request url. Then comes PHP to build the response, which is sent back to the browser. At no time can PHP edit the url. I can only parse data from it. You could only php to include some kind of js to manipulate the url. Edit: If you're only talking about creating segments, that can be targeted by such anchors, then that's easy. Just give the target an id attribute of that name: // Link <a href="#my-segment">Go to my segment</a> // Segment <div id="my-segment">…</div>
-
Best way to find when functionality was added?
LostKobrakai replied to gRegor's topic in Module/Plugin Development
I'm not sure how deep this issue goes, but fixing the pagination module issue can be quite easy. $pa = new PageArray(); $pa->setTotal($total)->setLimit($limit)->setStart($start); $pager = $this->modules->get('MarkupPagerNav'); $pager->baseUrl = $baseUrl; $pager->render($pa); -
Using PW variables in descriptions and notes
LostKobrakai replied to adrian's topic in Wishlist & Roadmap
Even the core does use links in notes, especially for the more documentation-needing features like for example the urlSegment whitelisting. So there needed to be a way to create those. -
Using PW variables in descriptions and notes
LostKobrakai replied to adrian's topic in Wishlist & Roadmap
You can link by using markdown [my-link](http://processwire.com). But be aware, it's not a full-blown markdown parser, which does this job, so other syntax might or might not work. About the overhead. Ryan did mention somewhere, when someone asked about better markdown support, that that would be a performance hit, so I'm not sure if it's wise to back notes/descriptions with features. It's really one of those "called everywhere and often" things. -
How to qery the state of an option at option fieldtype?
LostKobrakai replied to kreativmonkey's topic in General Support
I'm really much more keen on using semantic values in my code, as it's much more readable. 0=hide|Hide 1=article|Article 2=else|Whatever if($page->is("article_options.value=hide"){ //the hide option is ticked, clear markup $out = ""; } -
Only if you need to use "limit" in those selectors as well.
-
Better PHPDoc Comments in PW Classes
LostKobrakai replied to interrobang's topic in Wishlist & Roadmap
I'm just testing the PHPStorm trial and it would be really nice to be able to use it's full potential. -
How to do this: htaccess to only show correct url
LostKobrakai replied to OllieMackJames's topic in General Support
That would need an answer from someone other than me. I know that it works, but I'm a total noob when it comes to the actual syntax of those rules. -
How to do this: htaccess to only show correct url
LostKobrakai replied to OllieMackJames's topic in General Support
You could limit the removal of get parameters to just the frontend by disabling the rule for everything in the admin-backend "folder". Disabling them in the backend is a very bad idea as lots of core and 3rd party modules use them. -
Repeaters to have only basic unofficial support for showif/requireif settings. As most use-cases for repeaters are actually better be solved with page-tables it's unlikely this will change soon. If you really need those settings I'd suggest using page-tables instead of repeaters.
-
You can change it, but wherever you do so it's most likely to late to be picked up by the internal check, that compares the actual httpHost to the whitelisted ones. The changes would only be available to everything running later. The only way to have it pick up for the internal check, too, is by editing the config file itself, which could be made automatically. Another option would be supplying no httpHosts all together and call the check manually after adding all the needed domains. But it's a question for Ryan to answer if this would actually be of use for the security. @Soma I can understand that need. If you'd build some kind of SaaS software, where the user should be able to add their domains, you wouldn't want to edit those manually.
-
if($matches->count) { // we found matches echo "<h4>Es wurden $matches->count Ergebniss(e) gefunden:</h4>"; // output navigation for them (see TIP below) echo "<ul class='nav'>"; $tmpls = $templates->find("name^=nofile_"); foreach($matches as $match) { if($tmpls->has($match->template)){ // Matches template echo "<li><a href='$match->url'>$match->title</a>"; echo "<div class='summary'>$match->summary</div>$match->template </li>"; }else{ // Not matched echo "<li><a href='$match->url'>$match->title</a>"; echo "<div class='summary'>$match->summary</div>$match->template </li>"; } } echo "</ul>"; // TIP: you could replace everything from the <ul class='nav'> above // all the way to here, with just this: renderNav($matches); } else { // we didn't find any echo "<h3>leider wurden keine Ergebnisse gefunden</h3>"; }
-
The httpHost check is quite early in the bootstrap process, even before all the api variables are set or the database connection is established, so I doubt you'll find a way to hook anythings before that.
-
wire()->addHookAfter('InputfieldURL::render', function($event) { $field = $event->object; if($field->name != "yourField") return; $url = $field->value; if($url) return $event->return = "<img src='$url' width='100' alt='' />" . $event->return; }); This should do the job pasted at the beginning of site/templates/admin.php.
-
You could just hook the render function of InputfieldUrl and add an image tag before the input for that exact field. This would be the laziest of methods.