Skip to content
This repository has been archived by the owner on Jan 1, 2020. It is now read-only.

duplicate add buttons in collections #27

Closed
dbu opened this issue Oct 17, 2012 · 6 comments
Closed

duplicate add buttons in collections #27

dbu opened this issue Oct 17, 2012 · 6 comments

Comments

@dbu
Copy link
Collaborator

dbu commented Oct 17, 2012

in the cmf, we get duplicate add buttons when rendering collections. i tracked this down to be because of having an about attribute in the collection container even if we are inside the entity. either we have to remove this line: https://github.com/flack/createphp/blob/master/src/Midgard/CreatePHP/Entity/Controller.php#L107 and document that if you want a collection you at least need to render the definition of the containing element - or we need to document that you must render the collection outside of the entity (which seems wrong to me). or we could have a parameter to the collection render telling wheter we are inside an entity or not. but this becomes complicated...

as a side note, i also notice we output way too many namespace declarations because the elements do not know if they are rendered inside the scope of another element or not, when rendering the elements separately.

@dbu
Copy link
Collaborator Author

dbu commented Oct 17, 2012

@bergie maybe you can help us understand how RDFa thinks this should be? is it more "normal" to have a collection inside the entity it is related to or outside that entity?

@bergie
Copy link
Contributor

bergie commented Oct 17, 2012

Inside is normal, and you shouldn't need to duplicate abouts if you're already inside the correct scope. Can you post the actual HTML+RDFa that causes you problems?

@dbu
Copy link
Collaborator Author

dbu commented Oct 17, 2012

this is not a bug of create.js but really something we should fix in createphp i think.

currently for the example i hand-tuned to debug the creation issue, i get two about and this leads to 2 add buttons (i removed the duplicated xmlns for readability):

<div  xmlns:sioc="http://rdfs.org/sioc/ns#" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:skos="http://www.w3.org/2004/02/skos/core#" typeof="mystuff" about="/cms/simple/news">

    <h2  property="dcterms:title">News</h2>
    <p  property="sioc:content">The latest news about the Symfony CMF:</p>

        <ul  rel="dcterms:hasPart" rev="dcterms:partOf" about="/cms/simple/news">
            <li  typeof="sioc:Post" about="/cms/simple/news/symfony-cmf-website-update">
                    <div property="dcterms:title">Symfony CMF website update</div> (2012-09-28)
                    <div class="newscontent" property="sioc:content">A test news</div>
            </li>
        </ul>
</div>

@flack
Copy link
Collaborator

flack commented Oct 19, 2012

I added a workaround for this now, so that the second about attribute is removed when the collection is rendered as part of an entity (we still need it for standalone rendering, though). But after talking to @bergie, it actually seems to be a VIE bug that causes this, so I'm closing the ticket for now

@flack flack closed this as completed Oct 19, 2012
@flack
Copy link
Collaborator

flack commented Oct 19, 2012

P.S.: The issue about too many namespaces can be partly solved with the same technique, but for it to work fully, we would have to set the parent reference for collection children, which isn't possible with the interfaces the way they are now. Anyways, this should probably got into a separate ticket

@dbu
Copy link
Collaborator Author

dbu commented Oct 21, 2012

sure. i will try to have a look into this at some point. thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants