Code Monkey home page Code Monkey logo

Comments (5)

alexander-schranz avatar alexander-schranz commented on August 22, 2024

@gnsimoes this can be done by using the theme bundle as if the view template can't be found in the default folder or the theme folder the template will not be shown in the backend dropdown.

You need to add the theme bundle to your composer requirements composer require sulu/theme-bundle

As documented add the bundles to the AbstractKernel:

            new Sulu\Bundle\ThemeBundle\SuluThemeBundle(),
            new Liip\ThemeBundle\LiipThemeBundle(),

Add theme property to both webspaces.xml file after localization:

<theme>webspace1</theme>
<theme>webspace2</theme>

Configure the available themes in app/config/config.yml

liip_theme:
    themes: ["webspace1", "webspace2"]
    active_theme: "webspace1"
    load_controllers: false

Now if a template should only be available in webspace2 create the html.twig file of that template only in the theme folder: app/Resources/themes/webspace2/templates/example.html.twig.

from sulu-minimal.

gnsimoes avatar gnsimoes commented on August 22, 2024

Hi @alexander-schranz , thanks for your response,

Our question is not about the theming, that we have it well configured with Sulu documentation.
We want to know if it is possible to have in the administration interface, a set of page templates for webspace1 and another set of page templates for webspace2.
At the moment when you create a page, you have available all the templates created on folder app/Resources/templates/pages/*.xml.

from sulu-minimal.

alexander-schranz avatar alexander-schranz commented on August 22, 2024

@gnsimoes I did understand you correctly. The theme bundle is the solution for your problem.

Example we add a template app/Resources/templates/pages/example.xml which is configured as view this way: <view>templates/example</view> sulu will search for the view in app/Resources/views/templates/example.html.twig. As we don't want that this template is available in all themes you only create example.html.twig in the theme you want it to be shown e.g. app/Resources/themes/webspace2/templates/.

Now Webspace 1 show:

bildschirmfoto 2017-11-13 um 18 22 36

And Webspace 2 shows also the new added template as this is only available in that theme:

bildschirmfoto 2017-11-13 um 18 23 16

from sulu-minimal.

gnsimoes avatar gnsimoes commented on August 22, 2024

Ok, know I understand with your explanation :) thanks!
I will try on our project and let you know if we could resolve it.

from sulu-minimal.

gnsimoes avatar gnsimoes commented on August 22, 2024

Hi @alexander-schranz , it works!
Thanks for your help!

from sulu-minimal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.