This project is read-only.

hide Text(Html) Field in Projection

Topics: Core, Customizing Orchard, General
Oct 8, 2012 at 7:31 AM

thanks for your time

In my ContentType I have a 'Date Time Field'  and some 'Text Field(s)'
The Queries -> Layout ->Display Mode 'Properties' is checked.
The Title property is used to link to the Detail

In I'm able to influence (move, hide) e.g. the DateTime Field.
However: I'm NOT able to influence (hide) the Text (Html) field.

Question: How do I 'address' my Text(Html) Field named 'Description' in ?

PS: In fact, in the end, I like to ONLY show the text and NOT the Label (Description) for the user.

The'projection' otherwise runs ok!

thanks for your time and hints

<Match ContentType="Evenement">
        <Match DisplayType="Detail">
            <Place Parts_Common_Body="Content:before"
                variations I tested as well
        <Match DisplayType="Summary">
            <Place Parts_Tags_ShowTags="Nowhere"/>
            <Place Parts_Common_Metadata_Summary="Nowhere" />

Oct 9, 2012 at 3:20 PM

after shape tracing and lots of reading I'm  finally able to hide / show the fields accordingly with below 'placement'

Question: is it correct that I cannot hide specific fields BUT first have to hide ALL and then show the wanted text field ? Or is there a more elegant solution?

thanks for your opinion, ed

<Match DisplayType="Detail">
            <Place Parts_Common_Body="Content:before"
Oct 9, 2012 at 4:19 PM

No, you should be able to hide a specific field. I think what you got wrong above is that name of the shape: Fields_Common_Text instead, not Fields_Text.

Oct 10, 2012 at 5:30 AM

I agree that the very first 'placement' I gave was wrong. BUT something I still do wrong:
A) when NOT using ' Fields_Common_Text="-" '; I always see ALL fields! (the group of 4 are the fields defined in my 'Content Type'
B) when USING  'Fields_Common_Text="-" '; I ONLY see '  Fields_Common_Text-Description="Content:1" '

This is weird and I'm out of ideas!
Thanks for your time and advise, ed

<Match ContentType="Evenement">
        <Match DisplayType="Detail">
            <Place Parts_Common_Body="Content:before"

Oct 10, 2012 at 5:39 AM

OK, are you saying that <Place Fields_Common_Text-Description="-"/> doesn't hide the field? Did you try moving things around, exchanging that with the placement of Fields_Common_Text?

Oct 10, 2012 at 6:13 AM

I was probably not very clear:

In above placement I see the 'Description' content. ( Also with "-" I can hide Description)  HOWEVER:
Fields_Common_Text-Renseignement="Content:2" does NOT show me 'Reseignement'

AND without  Fields_Common_Text="-" I see ALL fields (except the DateEnd)

Quote " Did you try moving things around, exchanging that with the placement of Fields_Common_Text?" ; I don't quite understand what you mean?
thanks ed



Oct 10, 2012 at 6:43 AM

That doesn't make any sense. Are you sure you don't have any typos in the names of those fields?

(about moving things around, I was suggesting trying to play with the order of things)

Oct 10, 2012 at 8:22 PM

I understand your question about spelling because I made a typo in my previous msg.
I triple checked the spelling amongst : placement, Content Type, content item, query, projection - did not find any unusual things.
I guess I shuffled the placement statements any way possible in the meantime ...

well I'm out of ideas. I used also shape tracing but, to be honest, I'm not familiar enough to interpret it sufficiently.

I'm happy to give somebody an ID to check on my system!

Do you see any other means which I could try ...!
Again: I have other projections which just run fine! (although in the detail screen showing all fields i.e no hiding of fields)
PS: I still think it's an error on my side ...
Thanks for having another look, ed

Oct 10, 2012 at 9:36 PM

Well, this still seems weird to me as I'm doing stuff like that routinely, but as you seem to have precise repro steps from a vanilla Orchard instance, please file a bug.

Oct 11, 2012 at 3:39 AM

I am doing pretty much the same thing in the current release right now and it is working ok.   The one difference I observe in this thread is the use of

<Match DisplayType="Detail">

I am not using that, just the Match ContentType statement, but I can suppress text fields.

Oct 11, 2012 at 4:49 AM

thanks to both

Mark: I certainly tried also your suggestion - same result.

will now file a bug as suggested by Bertrand;
thanks for your patience, ed

Oct 11, 2012 at 8:53 PM

Well, hope nobody spent already time on this. It might be a (minor) flaw but I hope/guess I figured it out.

In my Content Type 'Evenement' I use a field 'Catégory' and consequently in 'Fields_Common_Text-Catégory="-" '. As a last desparate effort I changed this field to 'Category' and deleting the 'accent d'aigu' i.e é to e solved my problem.

Not that I know exactly why ... but it works! ... might be Bertrand has an explanation!? Or I missed that some special french characters are not allowed.
PS: the error happened when on 'default site culture' en-US! I have not (yet) tested when I change to the production culture - which finally is 'french' - might be it works there. However I can live without the " l'accent aigu" .
Thanks any way for everybody involved . you do a great job
Thanks ed

Oct 12, 2012 at 12:58 AM
Edited Oct 12, 2012 at 12:59 AM

Catégorie is the display name of your field, the one used in the UI. Categorie is the technical name, the one used in the Placement and code.

So you can still use Catégorie, but all your code will refer to it as Categorie. I just tried it and it's how the automatic technical name is generated, accepting chars only from a-z and A-Z, "é" not being in this list.

Look at the properties of the field, you will see the difference between the Display name and the Technical name.

Oct 12, 2012 at 4:48 AM
Edited Nov 29, 2012 at 9:03 PM

oops, sorry for not acknowledging. Understood and thanks, all is fine now