Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mustache features like parents, blocks and dynamic name does not seem to work #761

Open
uzoochogu opened this issue Feb 6, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@uzoochogu
Copy link

It seems that CrowCpp does not support the full mustache specification and this can be a problem. Specifically parents, blocks and dynamic names don't seem to be fully supported.

Parents and blocks

template1

<!DOCTYPE html>
<html>
  <body >
      <div class="ui segment">
              {{$page_content}}
               Placeholder
              {{/page_content}}
     </div>
    </div>
  </body>
</html>

template2

{{< template1}}
{{$page_content}}
<div class="ui placeholder segment">
   This is what I want to replace the placeholder
</div>
{{/page_content}}
{{/template1}}

template 2 should render:

<!DOCTYPE html>
<html>
  <body >
      <div class="ui segment">
             <div class="ui placeholder segment">
                 This is what I want to replace the placeholder
             </div>
     </div>
    </div>
  </body>
</html>

dynamic names:

template1

<!DOCTYPE html>
<html>
  <body >
      <div class="ui segment">
              {{>*dynamic_page}}
     </div>
    </div>
  </body>
</html>

template2

<div class="ui placeholder segment">
   This would be  interpolated if template2 is passed to dynamic_page at runtime
</div>

template3

<div class="ui placeholder segment">
   This would be interpolated if template3 is passed to dynamic_page at runtime
</div>

hash

{
"dynamic_page" : "template2"
}

template 1 should render:

<!DOCTYPE html>
<html>
  <body >
      <div class="ui segment">
         <div class="ui placeholder segment">
            This would be  interpolated if template2 is passed to dynamic_page at runtime
         </div>
     </div>
    </div>
  </body>
</html>
@gittiver gittiver added the bug Something isn't working label Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants