Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8052813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:39:16+00:00 2026-06-05T07:39:16+00:00

I have a folderish ATDocument class create through generic setup, generic setup xml configuration

  • 0

I have a folderish ATDocument class create through generic setup, generic setup xml configuration file has the following view variables defined:

<property name="immediate_view">TemplateFileName</property>
<property name="default_view">TemplateFileName_view</property>
<property name="view_methods">
    <element value="TemplateFileName_view"/>
</property>

Is it possible to replace that view with a dispatcher, i.e. a BrowserView class that on __call__ would dispatch an actual ViewPagetTemplateFile() instance?

I tried replacing template file name with a method name of that class but that doesn’t seem to work. Also I followed inheritance tree of ATDocument though ATCTContent to BaseContent, but I didn’t find any definitions of views, so I’m guessing views are processed via one of the inherited mix-ins.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T07:39:18+00:00Added an answer on June 5, 2026 at 7:39 am

    The names in the GenericSetup xml file are either view names or skin items; view names are looked up using the same traversal mechanisms as when you direcly name the view in the URL.

    So, anything you can reach with a URL can be used as a view method. That includes views that dispatch to other views in the __call__ method:

    from zope.publisher.browser import BrowserView
    from zope.component import getMultiAdapter
    
    class DispatchingView(BrowserView):
        def __call__(self):
            if somecondition:
                newviewname = 'foo'
            else:
                newviewname = 'bar'
    
            return getMultiAdapter((self.context, self.request), name=newviewname)()
    

    This example view looks up other views by their name, and renders them in place to return as the result of the dispatcher itself.

    Note that generally, I make sure that if a view is being used I make sure to include the @@ view namespace in front of it’s name to prevent that a skin item with the same name accidentally is being used.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have many folders of images, and I want to create a batch file
Greetings! I am creating setup file for my project.i have some folders in my
I have two folders in my asp.net web application in which I create new
Context I have a tree view with folders and files: Additional info All files
I have a custom folderish Dexterity content-type in Plone. It can have only Documents
I want it to have folders on a table view. And i mean folders
I have this tree displaying the file structure, I have folders and files. Some
I have this code, to initialize Scintilla with xml lexer: procedure TfrmWeMain.DScintilla1MarginClick(ASender: TObject; AModifiers,
For the sake of organization, I keep each class in it's own file. I
I have a project where I have folders, subfolders, and files. I need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.