More in this section

Forums / Developing with Sitefinity / multiple "generic content"

multiple "generic content"

11 posts, 0 answered
  1. Jesse
    Jesse avatar
    21 posts
    Registered:
    28 Nov 2007
    08 Jul 2008
    Link to this post
    I think I'm close, I just need that last step -- I went into the web config, added 4 other "generic content" pieces (registered, level1, level2, level3) and pasted them into all the necessary places.  Good news is I get a dropdown in the generic content module "Change Group" with all 5 listed (generic content, registered, level1, level2, level3) but when I change to say, Level1, there's a postback, nothing changes. 

    I know I'm missing something -- what is it?
  2. Pepi
    Pepi avatar
    981 posts
    Registered:
    31 Jan 2017
    09 Jul 2008
    Link to this post
    Hi Jesse,

    We must confirm this is a bug we introduced in hotfix 1616. Please, refer to the following KB article that provides a workaround for it.

    Do let us know if the provided solution helps.

    Regards,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Jesse
    Jesse avatar
    21 posts
    Registered:
    28 Nov 2007
    09 Jul 2008
    Link to this post
    worked perfectly, bug "confirmed".
  4. Jesse
    Jesse avatar
    21 posts
    Registered:
    28 Nov 2007
    09 Jul 2008
    Link to this post
    secondary problem ...

    under modules I have this ....

    <add name="Level1Content"
    urlRewriteFormat="[Publication_Date]/[Title].aspx"
    urlDateTimeFormat="yy-MM-dd"
    urlWhitespaceChar="_"
    visible="True"
    defaultMetaField="Name"  
    applicationName="/Level1Content"
    securityProviderName=""
    allowLocalization="False"
    allowVersioning="True"
    allowWorkflow="False"
    allowComments="false"
    commentsModeration="true"
    versioningProviderName="" connectionStringName="GenericContentConnection"
    type="Telerik.Cms.Engine.Data.Providers.DefaultProvider, Telerik.Cms.Engine.Data" />

    under metafields

            <add key="Level1Content.Name" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="Name this content" mandatory="True" />
            <add key="Level1Content.Description" valueType="LongText" visible="True" searchable="False" sortable="True" defaultValue="Add description here" />
            <add key="Level1Content.Author" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" />
            <add key="Level1Content.Category" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="">
            </add>

    if I try "applicationName="/" I get this error (I half expect this)
    A field or property with the name 'Name' was not found on the selected data source.

    if I give it an application name like "/Level1Content", the module loads, I get to saving the content and I get this error
    The given key was not present in the dictionary.

    ideas?
  5. Pepi
    Pepi avatar
    981 posts
    Registered:
    31 Jan 2017
    09 Jul 2008
    Link to this post
    Hi Jesse,

    Please make sure of the following:
        1. You have copied the News folder in ~/Sitefinity/ControlTemplates and renamed it to the name of the provider (for example Level1Content).
        2. You have copied the News folder in ~/Sitefinity/Admin/ControlTemplates and renamed it to
    the name of the provider.

    Regarding the applicationName attribute, it should be set to /Level1Content.

    For more information, refer to the User Manual > Working with Modules > Customizing Modules > Adding Providers.

    If this does not help, send us your web.config file to investigate it locally.

    All the best,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. Jesse
    Jesse avatar
    21 posts
    Registered:
    28 Nov 2007
    09 Jul 2008
    Link to this post
    I got the "Given Key" problem figured out (names weren't lining up 1:1) but now I have content in EACH of the 4 spots and permissions do not seem to work, at all. 

    Level3 is a member of role : Registered, Level1, Level2 and Level3
    Level2 is a member of role : Registered, Level1, Level2
    etc etc

    anonymous user can see all levels, so can any user that logs in (registered, level1, etc)
  7. Jesse
    Jesse avatar
    21 posts
    Registered:
    28 Nov 2007
    09 Jul 2008
    Link to this post
        1. You have copied the News folder in ~/Sitefinity/ControlTemplates and renamed it to the name of the provider (for example Level1Content).
        2. You have copied the News folder in ~/Sitefinity/Admin/ControlTemplates and renamed it to
    the name of the provider.

    I used "Generic_Content" instead of news.  Make any difference?

  8. Pepi
    Pepi avatar
    981 posts
    Registered:
    31 Jan 2017
    10 Jul 2008
    Link to this post
    Hi Jesse,

    I am sorry, it is my mistake. I meant you need to copy the Generic_Content folders in ~/Sitefinity/ControlTemplates and ~/Sitefinity/Admin/ControlTemplates and rename them to the name of the provider.

    Regarding the permission issue, it is not a bug. Actually, Sitefinity does not support this functionality out of the box, i.e. the permissions that are set in the module a
    dministration do not apply to the public controls (Content View, News View, Blog Posts and so on). We are currently implementing this feature and it will be available in the future releases of Sitefinity.

    Best wishes,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  9. Jesse
    Jesse avatar
    21 posts
    Registered:
    28 Nov 2007
    10 Jul 2008
    Link to this post
    That's really not good.  Alright, time to do it by hand.
  10. Jesse
    Jesse avatar
    21 posts
    Registered:
    28 Nov 2007
    10 Jul 2008
    Link to this post
    Came across this example ...

    http://www.sitefinity.com/help/developer-manual/extending-built-in-controls-example--extending-content-view-control.html

    which appears to be nearly perfect for my next idea...override the template path IF user permissions are enough.  I copy over the necessary controltemplates and admin/controltemplate files again per the instructions (minus 1 of them as you'll see in a second) and I tried the following code...

    public class Level1ContentView : ContentView
    {
        
    public override string SingleItemTemplatePath
         {
             
    get
             
    {
                   if (!Roles.IsUserInRole("Level1"))
                   {
                       
    object obj = this.ViewState["SingleItemTemplatePath"];
                       
    if (obj != null)
                                 
    return (string)obj;
                        return "~/Sitefinity/ControlTemplates/Level1/ContentViewSingleItem.ascx";
    }
    else
    {
              return string.Empty;
    }

    }

    set
    {
        
    this.ViewState["SingleItemTemplatePath"] = value;
    }
    }
    }

    I try to upload it as a user control as a dll I get
    An error occurred loading a configuration file: Failed to map the path '/'.
    and if I add it manually to the <toolboxItem> area, the control gives me this error "could not load file or assembly Level1.Controls -- ideas?

  11. Pepi
    Pepi avatar
    981 posts
    Registered:
    31 Jan 2017
    11 Jul 2008
    Link to this post
    Hello Jesse,

    Did you add Level1.Controls.dll assembly in the ~/bin folder of the project?
    For more information about declaring custom controls manually, please refer to the User Manual > Working with Controls > Uploading Custom Controls Manually.

    Do let us know if you need any further assistance.

    Greetings,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Register for webinar
11 posts, 0 answered