Thanks!
Sent: Thursday, March 18, 2021 10:47 AM
To:
dot...@googlegroups.com
Subject: Re: [dotcms] Access Contentlet properties in Container, version 5.3.8.2
CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
________________________________
Solution, as requested.
This is the Container code for 'Content (Generic)', should actually be usable for almost all content.
I think dotCMS inserts the first text field into title if there isn't a 'title' in the structure declaration.
<div class="content-wrapper" id="content-$!{ContentIdentifier}">
#if($EDIT_MODE)
#set ($info=$dotcontent.find($!{ContentIdentifier}))
#set ($us=$cmsuser.getUserByUserId($info.modUser))
##User field information :
https://dotcms.com/docs/latest/cmsuser-viewtool<
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fdotcms.com%2fdocs%2flatest%2fcmsuser-viewtool&c=E,1,PGOAOi1Snfd3Wqp1kcIT2yZu7bbRPf2fCwSHW2iHBnIK41j49I-UapFEP63jqcZVZMdv2WSEUBLZlEuxFEyrqjPR7Tr7kc_LtnlmKqxE&typo=1>
<fieldset>
<legend>Title : $!{title}</legend>
Type: $
info.contentType.name<
https://linkprotect.cudasvc.com/url?a=http%3a%2f%2finfo.contentType.name&c=E,1,tVk2YqNDxX4cnkXUelqCZCnKYVPo9-7GthPXDdny-qfvIKe1MOWhq26WNewCMvya-XUfJYwvKocZ8PIMqTy67zHJ7gg6SCaIIa9mCnSlmyFxlSrV2v9UtW2r&typo=1> <br>
User: $us.firstName $us.lastName
Published: $info.lastReview <br>
Modified: $info.modDate <br>
</fieldset>
#end
$!{body}
</div>
I actually do more in my Generic Content as I have a binary image file option, and if it is set, I display the picture. If anyone is interested in that code, I will show it, but it is trivially easy to do. Once I did that, my users never again had to use the img tool.
Mark Pitely
Marywood University
On Tue, Mar 16, 2021 at 3:43 PM Mark Pitely <
pit...@maryu.marywood.edu<mailto:
pit...@maryu.marywood.edu>> wrote:
Hah! Ye of little faith. You mean WHEN I figure it out, right?
Of course, I will post the completed result. I'm still hoping someone gives me a big clue so I can make it much cleaner.
I'm not worried about speed since it is only EDIT_MODE, but still, I shouldn't have to make a second and third query to get the fields or the user info. But if I have to, that's what will happen.
M
On Tue, Mar 16, 2021 at 3:31 PM 'Nathan Keiter' via dotCMS User Group <
dot...@googlegroups.com<mailto:
dot...@googlegroups.com>> wrote:
If you figure it out, can you post the final result for us?
Nathan I. Keiter | Lead Network Applications Programmer | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone:
717.337.6993
https://www.gettysburg.edu<
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.gettysburg.edu&c=E,1,WjkuBegtzqLAD9BVAU4n-GSMjX85hTDmLktg40cY2fnSgu4b-fu6ITkYfkNthemR0vmmZaILBioGIX4UmJhnVzFk-jTNdv7BqV7adKYfl-o,&typo=1><
https://www.gettysburg.edu/<
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.gettysburg.edu%2f&c=E,1,LCzgNOinl37WvuS2F6hWCMQnMcYUsGcdtdIyaFuNtD6gxUk4drVrm6kDjoNFFpZ5RNzOiz3nmmv1bwmtCE6SNA6ihV8eGY3EFA-kpw5d4GRt1CVmm8V8VfLjdmM,&typo=1>>
Sent: Tuesday, March 16, 2021 12:27 PM
To:
dot...@googlegroups.com<mailto:
dot...@googlegroups.com>
Subject: Re: [dotcms] Access Contentlet properties in Container, version 5.3.8.2
CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
________________________________
Yes, this is in the container!
I have lastReview, modDate and modUser working with this approach.
modUser, however is giving this 'user-c65525c1-3aaa-4f66-916f-8e341efbfd51', can't seem to use $
info.modUser.name<
https://linkprotect.cudasvc.com/url?a=http%3a%2f%2finfo.modUser.name&c=E,1,tknbeALhf8boKmoUcRsxseJJ_F1pO1EzjiXhfQSk_klRBy97-1aoQnrc9o6YvyKzQSWEWZIcu01cttTOplBgP_UL5GDyAwIGb6ETTWWsNTTrq1MorrPa&typo=1><
https://linkprotect.cudasvc.com/url?a=http%3a%2f%2finfo.modUser.name&c=E,1,1DfiWub1MhrNOCRv2Ifxrtybf00trF8DqKXDXyXmmtko-DpFDBt1yq2D9rYVmbEFrd7eASyLFTjkmAZrsFcP99eUoarG1joBH17tZS4bNZMywuYPn-s1Vn8N&typo=1> or $info.modUser.email<
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2finfo.modUser.email&c=E,1,opbjSOUqSs44ea7zTi2HpUkxr3yowUvJ67yaY5_7sipyueRoO8bzGcPjuKsFDh9W5mD1JVyX4P9WgxfJw-qPHPyv5xcmFxbk4OTxsgmj&typo=1&ancr_add=1><
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2finfo.modUser.email&c=E,1,zmQkojWUbISCP0SrYvR1H4_tDO0W8cxDzPUaHulMB9CxtCTUrTqd5ofnwKXt--NY2l8OK4tNXXgMrP1LAJPwZWT_cj1trO3rwgy9KGkhGrBKmtk,&typo=1&ancr_add=1>, but I'll keep hacking at it.
#set ($info=$dotcontent.find($!{ContentIdentifier}))
<fieldset>
<legend>Title : $!{title}</legend>
Type: $
info.contentType.name<
https://linkprotect.cudasvc.com/url?a=http%3a%2f%2finfo.contentType.name&c=E,1,wfx2tSoLuZjY2zegDEFMID1ykXe2IdYfbX__Ssi5uu32cIqUrhdIXQBBe7uHtgEo63SzcPBau7HWkaXVr5AOnyF8mzTcAeL2CUhSBDEVnKazL9CeIKPkyTla4Zjs&typo=1><
https://linkprotect.cudasvc.com/url?a=http%3a%2f%2finfo.contentType.name&c=E,1,iBKepJwzZuxhsIZPgCdvWqXt9LiaRZHNGNWfuVuMe-KX7H_LXVVM38L_ba7ChjatU-jQrOBTSPIrFLYKaxAC0i2lx1YrAs1dpNbe54awNXlxHZZ17whE&typo=1> <br>
User: $info.modUser <br>
Published: $info.lastReview <br>
Modified: $info.modDate <br>
$info
</fieldset>
On Tue, Mar 16, 2021 at 12:22 PM 'Nathan Keiter' via dotCMS User Group <
dot...@googlegroups.com<mailto:
dot...@googlegroups.com><mailto:
dot...@googlegroups.com<mailto:
dot...@googlegroups.com>>> wrote:
That's a really cool idea. I think it would be better to put this code in the container though. Having it in the content could get hard to maintain and enforce?
Nathan I. Keiter | Lead Network Applications Programmer | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone:
717.337.6993
https://www.gettysburg.edu<
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.gettysburg.edu&c=E,1,8gb-3DG-L1UlgWtbtn3kzo9JQu--cVOdnucIXvKq0qOnBC_4OrHIj0j0fbU7vv9PZEsI4jhK62FBu897Zu3neZE_7ioSoPod1fxgvR9Qrq9kFw,,&typo=1><
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.gettysburg.edu&c=E,1,sXNAHxNk0eUva7NUcDP4jTO51cvyisUXp2fvyNwYnUVRlTojOTfGcIB09dKlpP9OVWoTmsu0ES0ThwveMi9SoP7XWNZZC09sl73InjDkTPdLK9tv8z0EbE-6oQ,,&typo=1><
https://www.gettysburg.edu/<
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.gettysburg.edu%2f&c=E,1,_Yr3Ss8KhfZj3nbfVqn8PQzSo8DYtUylOr99zmX3OoKx5g5BtS2WkzZwTwDwuRsxIHqt4AX8-fUTI0LQGblJ8uqm0IYXQRfzNnVWgXSlDkTqrBrDdPTX1Q0eMPri&typo=1><
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.gettysburg.edu%2f&c=E,1,4i_LEuDKWvU3LDtrbX35DwxMdb5oGZEijXOpDpOrtbRseRvCM_uKbtelhATjnhV_AzygLfRucfbeesioe4uFxgS0c6V7nBVl6zdBcxysX3rzJgJYAZt9osw,&typo=1>>
________________________________
From:
dot...@googlegroups.com<mailto:
dot...@googlegroups.com><mailto:
dot...@googlegroups.com<mailto:
dot...@googlegroups.com>> <
dot...@googlegroups.com<mailto:
dot...@googlegroups.com><mailto:
dot...@googlegroups.com<mailto:
dot...@googlegroups.com>>> on behalf of Mark Pitely <
pit...@maryu.marywood.edu<mailto:
pit...@maryu.marywood.edu><mailto:
pit...@maryu.marywood.edu<mailto:
pit...@maryu.marywood.edu>>>
Sent: Tuesday, March 16, 2021 12:06 PM
To:
dot...@googlegroups.com<mailto:
dot...@googlegroups.com><mailto:
dot...@googlegroups.com<mailto:
dot...@googlegroups.com>>
http://dotcms.com<
https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,yIpsTAGAExcorkkaworr--bTRnqbEhvjMxqvrvfU3AVeIN9xoPgYHyuhWvf4PAe0NrzKCpdEUlQ8SDyASnZYh5pHmz5xBEJuUZfsBSA2xESqFUB04nf9hm2MeX9h&typo=1><
https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,H78b3T_0ueUp2hF9PxcPs5-xAHaCaKQY8ThFnJ5y8brY-NVBsoY52oYF6aad4FlrQwYVnJPUOAXqNpBreNT7BYqyy60JRwWyn1nTtCA_WB_CiA,,&typo=1><
https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,AQsxMJQwgAAkj-miQBcRbo_sB8QeEHqiE99GWvu7jQojw6sg5MKOYccUbAG245JKVcjWe5f9c8gtkUn0HTJ26iYIwEM5GVlPv0ojtCq64mEHwVOL9mXg&typo=1> - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
dotcms+un...@googlegroups.com<mailto:
dotcms%2Bunsu...@googlegroups.com><mailto:
dotcms%2Bunsu...@googlegroups.com<mailto:
dotcms%252Buns...@googlegroups.com>><mailto:
dotcms+un...@googlegroups.com<mailto:
dotcms%2Bunsu...@googlegroups.com><mailto:
dotcms%2Bunsu...@googlegroups.com<mailto:
dotcms%252Buns...@googlegroups.com>>>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/dotcms/CAFeiKqMUmiJkrfZd%2BO4TCxXHyBrPaYsBF36u0Y2KSTAt%2BrR4%2BA%40mail.gmail.com<
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2fCAFeiKqMUmiJkrfZd%252BO4TCxXHyBrPaYsBF36u0Y2KSTAt%252BrR4%252BA%2540mail.gmail.com&c=E,1,ll4pwOjFmaSbE7dfcTGpl7U7QWKXWUNrXTchUp-vL_FaKX6czSIqawKSaHHcxyqh73CRXg1rfvEYk1AqWwGV6SL_R-9JNaPMF1PpWfo1JBsUTXVHRmdoxA,,&typo=1><
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2fCAFeiKqMUmiJkrfZd%252BO4TCxXHyBrPaYsBF36u0Y2KSTAt%252BrR4%252BA%2540mail.gmail.com&c=E,1,6MxF9YZnRwC_BP74cULZVZuuvWHyADSp-vKm8chR1bldt4Ld5kIh_WKAoZah3w6PfNVy-kjyO8FLV5guqEGf-8ePw7hUo5FrdzqcXmzUHaNksrWA4wsdNw,,&typo=1><
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2fCAFeiKqMUmiJkrfZd%252BO4TCxXHyBrPaYsBF36u0Y2KSTAt%252BrR4%252BA%2540mail.gmail.com%3futm_medium%3demail%26utm_source%3dfooter&c=E,1,M1OIKWSncPbTtxFn0K0ZYGfLz9PGDh7V1g1eifUk0wcHYbZ3RrmvXdrwWEjtUHSAlM9IvhVwSAW8yh9UfQrX03gQ6hLgR9AdQ5wmA9M2waER0AofX_8u&typo=1>.
--
http://dotcms.com<
https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,TCWx0_5-2S2fkB66YzP2HJDIJC8ZdfjQp4djiYq7JmTI4aKJ6zmAMvygp8KBm2nXi2Egwqxr1d2uM97LMmHT9i6mLhrr6cupu8vOLgNV&typo=1><
https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,YXKCOwFBj_9kkM_VI_SiAJqbPdQhROa1oG-2YoYjzC0B4UMcWxW45J9xDx9N1yaCtcYyEn4kO8P3D2q7xvX97uzMKmS6Lc8-PUvOOxspmIoN&typo=1> - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
dotcms+un...@googlegroups.com<mailto:
dotcms%2Bunsu...@googlegroups.com><mailto:
dotcms%2Bunsu...@googlegroups.com<mailto:
dotcms%252Buns...@googlegroups.com>>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/dotcms/1615911738451.6226%40gettysburg.edu<
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2f1615911738451.6226%2540gettysburg.edu&c=E,1,S4RZnzh9QuLvvRICBiPGOvB6fPHUl2e4pDBW28WB8m358YCzCH4SDMQh0_q7AV88KPnenK1R0vo4lsM5VjkcsE3pZ4qMa3Qaw2dz4wdfYBhQbMrPhwY,&typo=1><
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2f1615911738451.6226%2540gettysburg.edu&c=E,1,UTSiHypS6WxGSfm4aOUWFDV6aYSeny8WViMh5R0iWa1dJIZ4bO2t-1N6iDenNfGaSa2MCSb7Qlx652qGiYGX8QRN4ZPkuxErioLLQ4UrBM0oTVUZ-jEoH1NUag,,&typo=1>.
--
http://dotcms.com<
https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,OG8nSymvt0oZsMMu0cjwkQAP9FwL1inoCsqGYi0z6G7c9_O5zYEPQkQUxUOh6XLg4hC5NakejAMfB-yKkQXkxyRa4vGSp40hFSzC-kXKvGqY5pcE7lWccP0,&typo=1><
https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,6nRwQsuQPclBAFIuTRmBZzcd_h1seDd6PJCcrbuj0bc-6XUcIY7FrANV2RCzl_9Nze24WH57N0coiVdiIjsNeHQ-PoSQj31Tx9nds8_8cQ,,&typo=1> - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To view this discussion on the web visit
https://groups.google.com/d/msgid/dotcms/CAFeiKqPJ1_p4JFKQxZdPK55AuXMkR0YQWMMbj-P83NDMxn0X4w%40mail.gmail.com<
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2fCAFeiKqPJ1_p4JFKQxZdPK55AuXMkR0YQWMMbj-P83NDMxn0X4w%2540mail.gmail.com&c=E,1,iQv_e6R2ZYHlZHUpZwm1lWKl4UfwxMQQfk6EqhfqFFreYT5xtswsHcg0PSOuZmBV6boba_gPL7akQe_3WrSY0cBqo1ulnOGo2V9KqzZoKyhdCgpOeYsh78-a&typo=1><
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2fCAFeiKqPJ1_p4JFKQxZdPK55AuXMkR0YQWMMbj-P83NDMxn0X4w%2540mail.gmail.com%3futm_medium%3demail%26utm_source%3dfooter&c=E,1,mAWnrpm-gTwr0tjW16MXLdu1bjVcePf-Qoo4jvqpi69OkMma4H6PsQqA9cj22q_Ch8UEvrLrIptuHDefxAWocy8N20ThpKSbGimoguUDJqUOlfSoEeOrtLs,&typo=1>.
--
http://dotcms.com<
https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,jVgXxfJnis5JbNQTgETUjAzdYKhaE7EpGyYXZrfIjebMG_tb1AdkSOqPfd7V2jw6DZkEgRxjSps57MMY_iAZR6txbH-sGt3ssiGWjyEEitvFr-8,&typo=1> - Open Source Java Content Management
To view this discussion on the web visit
https://groups.google.com/d/msgid/dotcms/1615923097999.26163%40gettysburg.edu<
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2f1615923097999.26163%2540gettysburg.edu&c=E,1,h15k0awpuGdJ0aj5YVZVByY6SVVoLtH7CnDaUJ2bIslatarlGzOWfbJQG5Y6A65FusnOOECQSdXbxH5bLEoiSQqJWMkhm6jWcL15llLWSQq7A60,&typo=1>.
--
http://dotcms.com<
https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,q2IQHLcoiq8ihUMh9Pzxvg48tDgXDa14FgxMTtjC6-BQgA2bFJ6CtcZ4mCuGHmf0MwNbmgSyb4Tn3i5t7IM1o_uIwEsiQzlP9N2RJ8Tlhut2R9LSdyE,&typo=1> - Open Source Java Content Management
To view this discussion on the web visit
https://groups.google.com/d/msgid/dotcms/CAFeiKqM1QEZTy%2B-TDO4HxLybO7Z6X5XGsaWAoN52fcDokpVm%2Bg%40mail.gmail.com<
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2fCAFeiKqM1QEZTy%252B-TDO4HxLybO7Z6X5XGsaWAoN52fcDokpVm%252Bg%2540mail.gmail.com%3futm_medium%3demail%26utm_source%3dfooter&c=E,1,zLuw4uXAXfXLUoREWlfIbtpw4TS3iHkGHrwlFUHOCU2_Weuj1qutO4NWzh0Ix8djow6haQqo19AHn7r6DQsS1xrfnS6n-xedjMJL3ujhSg,,&typo=1>.