class Comanche fork

neue medienordnung plus
  
I use often one lang-selector block <div class="container lang-selector">
    <div class="row justify-content-end">
        <a href="" class="lang-choice btn btn-default">de</a>        
        <a href="" class="lang-choice btn btn-default">en</a>
        <a href="" class="lang-choice btn btn-default">ru</a>  
    </div>
</div>

in my webpages. I see that for example comment -tag is generated presumable with this section

class Comanche {
    function parse($s, $pass = 0) {
        $matches = array();
        $cnt = preg_match_all("/\[comment\](.*?)\[\/comment\]/ism", $s, $matches, PREG_SET_ORDER);
        if($cnt) {
            foreach($matches as $mtch) {
                $s = str_replace($mtch[0], '', $s);
            }
        }
[...]
}
}


in class Comanche. Is it very complex class Comanche for one section to complement so that in this dialogue

Image/photo

by typing  lang-selector. Comanche generate those code:

<div class="container lang-selector">
    <div class="row justify-content-end">
        <a href="" class="lang-choice btn btn-default">de</a>        
        <a href="" class="lang-choice btn btn-default">en</a>
        <a href="" class="lang-choice btn btn-default">ru</a>  
    </div>
</div>

What must I do, so that Comanche do it for me ;-)?

@Hubzilla Development+ @Hubzilla Support Forum+ #Comanche #classComanche #langSelector #ComancheFork
Andrew
  
I think what you want to use is the existing capability of block webpage elements. If you create an HTML type block element with the HTML in your language selector, then you can include this in your pages by referencing this block in your page layout.

If you had a page layout with content region like this


[region=content]
[block]lang-selector[/block]
$content
[/region]


the selector would be at the top and the page element content would be rendered below. Multiple pages could use this same template as long as the page content was different, for instance if they had translations of some content.
Mike Macgirvin
  
What must I do, so that Comanche do it for me


1. build a drag-drop page design interface which hides Comanche under the covers.

2.

[block]lang-selector-block[/block]


If you want less typing, perhaps call the block 'lang' or even 'l'.

3. Add an autocompleter to the pdl editor so that when you type [b it completes the block statement for you. (My memory is vague - this may exist already).