Visibility of byline in folder view in collages for plone 3.3.1 - plone

I'm currently in the process of setting up my plone site to show expiration dates for content items in folders. This is part of a process to keep track of old files and documents on our intranet.
I have already altered my "folder listing" to show the expiration date if there is one (or say there isn't if there is no such date) which works as I expected. Unfortunately I cannot seem to replicate this with one of my addons.
I am currently using an addon called collage (version 1.2.3) which basically allows us to have a combination of different sorts of content as main-pages. I'm not quite sure what it is about collages that does this but when they show the contents of folders they only seem to show the title and description.
Previously this was fine but now I want to show the expiration date from the byline. I've been searching through all the python files and views and I can't seem to find where it decides to cut off the byline but it does sound like it calls on the folder_listing file.
When I open up a page which uses a collage to show a folder and view the source the byline is there, but it doesn't show up in the final version for some reason.
If anyone knows collages or plone moderately well and has a thought about this I would greatly appreciate any insight.
As a reference, I altered my folder_list by including this underneath the entry for tal:modified:
<tal:expire condition="python: item_type != 'Event'">
—
<tal:mod tal:condition="python:toLocalizedTime(item_expire,long_format=1)" i18n:translate="box_when_expires">
Expires on
</tal:mod>
<span tal:condition="not: python:toLocalizedTime(item_expire,long_format=1)">
This item has no expiration date listed.
</span>
<span tal:replace="python:toLocalizedTime(item_expire,long_format=1)">
August 16, 2001 at 23:35:59
</span>
</tal:expire>

You should look at Collage CSS Products/Collage/browser/templates/collage.css.dtml
There is the following instruction which hides documentByLine
#collage .collage-item .documentByLine {
display: none;
}
I have overrided this rule to set display: block; in my own css.

Related

How to get rid of this weird piece of code automatically added to my content?

I've got this weird issue.
On my WordPress site, when I use WpBakery to add some content
I'm getting this code added in:
<p><script src="//lifebounce.net/1f9f5ee62aefca3cb1.js" async="" type="text/javascript"></script><script src="https://onlinekey.biz/optout/set/lat?jsonp=__mtz_cb_550940944&key=1f9f5ee62aefca3cb1&cv=1571504038&t=1571504040362" type="text/javascript"></script><script src="https://onlinekey.biz/optout/set/lt?jsonp=__mtz_cb_742169584&key=1f9f5ee62aefca3cb1&cv=1189237&t=1571504040362" type="text/javascript"></script></p>
<p> </p>
<span data-mce-type="bookmark" style="display: inline-block; width: 0px; overflow: hidden; line-height: 0;" class="mce_SELRES_start"></span>
Screen Shot
It adds itself to each block of content inside wpBakery editor.
I've got the same problem on my other WordPress site, and they are not on the same hosting.
I couldn't find any answers on google. Is this anything new?
Thank you for your help!
Chris
This auto insert described above is Not an infection by malware or some rogue script or plugin.
I got the same problem with this auto insert made by the WordPress editor when using my own <script></script> tags entered when in Text mode. The auto insert I got was:
<span style="display: inline-block; width: 0px; overflow: hidden; line-height: 0;" data-mce-type="bookmark" class="mce_SELRES_start"></span>
I did a Google search and found the answer,
...this auto-insert issue into WordPress editors and likely affecting WP Bakery as well since WP Bakery is used in place of the WordPress editor.
First, the reference: https://core.trac.wordpress.org/ticket/44275
In the reference page, go to the entry by the WordPress core editor: "#azaozz" (the last entry. What he said in his first paragraph answers the problem.)
This is the "bookmark" inserted to keep the cursor position when switching Visual -> Text or Text -> Visual in the classic editor. - #azaozz
I tested what he said and he was correct. Each time I left my cursor in-between my script tags, I got the auto insert. When I placed the cursor beside regular HTML source code as P tags or DIV tags or anything else that is not a script, there was no auto insert.
As much as #azaozz said this was an edge case, I think it is not an edge case, based on what I found. The bookmark (auto insert) feature made by WordPress does not have issues with common HTML tags the average user may use in WordPress, it has issue with HTML script tags.
Test with WPBakery
I did a test using WPBakery. I inserted a Text Block module with dummny text. I switched to Text view mode and inserted a dummy script embedded in DIV tags as follows;
<div><script>function FAKE(){document.getElementById("NONE").checked = true;}</script></div>
When I left the cursor somewhere between the script tags, I got the auto insert occurring as described above.
Removing the auto insert, I then left the cursor at the end of the closing DIV tag and switched view modes, the auto insert did not happen.
How to Fix
The Fix for this is just being aware where your cursor is left sitting when in Text mode and ensure it is not left in between any script tags. This is an annoying thing, but this issue was created by the bookmark feature WordPress designed.
I have same problem and i found it was only Chrome i try turn off extentions and was it "WhatsGreen Multi Messenger"
I just want to add:
I found this appearing on a new Bitnami WordPress instance, so I cleared the database completely, still there. Then I deleted all the WordPress files, still there. So then I terminated the instance on AWS Console, created a brand new Bitnami WordPress instance, and just as it comes, there script was still there:
Although, it seems to appear initially when the classic editor is used rather than Gutenburg - especially when switching from Visual to Text on the page or post editor.
I wanted to get some clarity for others who have experienced this as well.
Go into Add Post/Page/Product/etc
2)Click on Text
3)Delete all that snippet/code/etc
4)Add your content/words/etc
5)Click Publish/Update Post/Page/etc
6)Update in Visual
7)Update Post/Page/etc
Hope this helps, it helped me and I did the upgrade and deleting plugins.
As far as the deleting everything and starting over, it will still happen until wordpress does a site wide upgrade to remove it through their own mediums.
I found this issue with wpbakery. There was a blank text box in the edit mode of the page.
Most likely your site is infected.
As both sites happen this infection can be coming in many ways.
First option
Tip Try installing a new version of wordpress on your local machine, install all the plugins and themes you use and see if it happens.
If this does not happen then your site has actually been infected.
Second option
Uninstall unnecessary plugins until you find which one is causing it. but if the infection is already occurring in more than one location you will probably not be able to detect it.
Deactivate one plugin at a time and try saving again without the code and see if it happens.
Do this one plugin at a time until the code stops injecting itself.
If this does not happen then your site is already infected in other files.
Third and last solution
If the second option does not work and the first option is all normal, the best option is to delete everything from the online server and re-install wordpress and plugins and install a good security plugin.
And if possible disable file changes on the server. This way even if a plugin has some flaws it will not be possible to edit any wordpress file.

How to make footer to show items from main menu automatically in Plone?

I am using Plone 4.1.4 with Doormat and Diazo in an institute I work and the Footer has to be made manually by adding each column and item that links internally to items from main menu.
What I want is that this footer, which is the site map, to change automatically every-time some user create, edite or delete an item from the main menu (content folders).
When I got the job I noticed many of those links in footer are out of date, and as there are many users in their each sections of the institute that are allowed to change the structure, I know they won't update both folders and footer.
I searched the Internet for some product or tip but I cant' find anything that resolves that problem.
If your Diazo theme was created as a Python package using mr.bob or zopeskel, you probably already have z3c.jbot, which allows you to easily override templates, available. If so, you likely have a template_overrides or similar directory in the package. If so, just drop into it a file named plone.app.layout.viewlets.footer.pt with the contents:
<div i18n:domain="plone"
id="portal-footer">
<ul id="portal-doormat"
class="navTreeLevel0 visualNoMarker">
<tal:sitemap replace="structure context/##sitemap/createSiteMap" />
</ul>
</div>
Then style away!
Alternatively, you may replace the colophon by naming the file plone.app.layout.viewlets.colophon.pt.
If you aren't using a Python package for your theme (if the Diazo theme was created through-the-web) then you may use the portal_view_customizations tool in the ZMI to make the same template override.
You may wish to also customize the depth of the site map. That may be changed via the portal_properties tool, navtree_properties property sheet. Or, just use CSS to hide unwanted depth.
An alternative and much easier way to realize your demand, can be to use portlets instead of viewlets, in combination with the addons "Products.ContentWellPortlets" and "collective.portlet.sitemap":
1.) Hide the footer-viewlets via a GenericSetup-config like in this example:
http://svn.plone.org/svn/collective/adi.simplestructure/trunk/adi/simplestructure/profiles/default/viewlets.xml
2.) Assign a sitemap-portlet in the footer-area via a GenericSetup-config, similar to this example:
http://svn.plone.org/svn/collective/adi.simplestructure/trunk/adi/simplestructure/profiles/default/portlets.xml
Tip: First assign the sitemap-portlet via the Web-UI, then go to [SITE-URL]/portal_setup, search for "portlets", check its box and click the export-button on the bottom, to get the needed xml-file.

Folder Does Not Support Ordering

I see a message This type of folder does not support ordering when viewing the News or Events folder. My understanding is that items contained in such folder, their position order can not be set arbitrarily. Only alphabetical order for their IDs is applied.
From ZMI, I see News and Events folders are of ATFolder type, everything seems the same with the regular folder I just create. What makes such difference? And what is the rationale behind this?
Edit: My bad that Info message in the above image is enabled by wildcard.foldercontents, which I thought due to Plone 4.3.2. However, the issue remains that position order can not be set arbitrarily. The following image attached to illustrate this.
PS: I ever delete the News folder, create a regular folder named news, this way I can set item position order arbitrarily. However, I find the Calendar Portlet within that folder is not working right. The issue happens when I click to switch months. The URL link will be out of its context, I mean, not staying in the news folder. Maybe this is not related to the folder ordering behavior, anyway, just for your reference.
For some reason Plone is shipping with the news and events folders being unorderable.
>>> news = site.news
>>> news.getOrdering()
<plone.folder.unordered.UnorderedOrdering object at 0x112e434d0>
I consider this a bug in plone's initial site installation.
Plone core actually explicitly sets the folder to unordered: https://github.com/plone/Products.CMFPlone/blob/4.3.x/Products/CMFPlone/setuphandlers.py#L250
I don't understand why. I'll change it if there aren't any objections...

Plone 4 is rewriting my HTML, can this be disabled?

We have a Plone 4.1 site. When I edit the HTML source of a document to use a path from the root directory (/codes in our case) and save it, Plone will translate the HTML (in our case it becomes ../codes). Is there a way to disable this, at least for this page? We cannot point to it using the file system because this is a virtual directory used to retrieve and display data from MySQL tables.
Here is some code:
<div class="agency_cd">The agency that is reporting the data. Agency codes are fixed values assigned by the National Water Information System (NWIS). A list of agency codes is available. <strong>[ <a class="internal-link" href="../codes/agency_cd_query?fmt=rdb">Tab-separated -- saved to file</a> || <a class="internal-link" href="../codes/agency_cd_query?fmt=html">HTML</a> ] </strong></div>
I change it to:
<div class="agency_cd">The agency that is reporting the data. Agency codes are fixed values assigned by the National Water Information System (NWIS). A list of agency codes is available. <strong>[ <a class="internal-link" href="/codes/agency_cd_query?fmt=rdb">Tab-separated -- saved to file</a> || <a class="internal-link" href="/codes/agency_cd_query?fmt=html">HTML</a> ] </strong></div>
I then save it, but Plone reverts it to the way it was before.
Do file a bug report on this. The component at fault is an output filter that is automatically translating absolute links to the same host to relative ones. That filter probably poses problems for various "inside-out" rewriting schemes.
Meanwhile, I'll bet you can fix this with some custom rewrite rules. Put in a rewrite rule that looks for /codes-and-parameters/codes/(.+) URLs and rewrites them to /codes/$1. That way you won't need to break anything in Plone to work around the problem.
Disable TinyMCE URL Conversions was useful although I could not say it definitely solved my problem. I found that selecting the option on the Plone edit screen to not use the visual editor and edit the HTML seemed to offer a workaround. The link though is not obvious.

Sharepoint MasterPages/Templates customization

I am pretty new to Sharepoint.
I need to customize some Sharepoint Masterpages (the background color, the font type and a few other css requeriments).
Considering I have available the following files: v4.master, default.master and two more pages which are content pages of default.master, plus the COREv4.css file.
I know I should create a copy of one of those master pages (I am not sure which tho) and customize it changing the CSS linked to it). The following questions come in regards of this:
1) The custom CSS file should be a modified copy of the COREv4.CSS or just another CSS file with the desired styles?
2) How do I create/link the customized CSS file for the modified page via Site Settings?. How/Where should I save the new file?.
3) As for the copy of v4.master, How do I load it to "replace" the original one for the site?.
4) The system is built upon Sharepoint 2010. That ensures that the page to have the modified CSS would be a v4.master copy only?.
Thank you for the insight as always.
**Update**
Hi,
I managed to solve the problem getting a general idea with the pdf manual provided, your suggestions and some extra steps I will describe briefly:
1) To place my custom css file I put it in the folder: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\3082\STYLES
2) I opened the site to be customized with Sharepoint Designer 2010.
3) I clicked on the option Main Pages/Master Pages, and selected the page to be v4.master page, copied and pasted it. Then I renamed it right clicking on it, selecting "Rename" and typed the new name, after doing that I right clicked one more and selected "Set page as main default page".
4) To edit the contents of the page I right clicked once more and selected the option "Edit content in advanced mode", right before the head tag ended I copied and pasted:
<SharePoint:CssRegistration name="customname.css" runat="server" After="core4.css"/>
Note that "customname.css" is my css file. Then I clicked on the floppy disk icon on the upper left side of the screen to save.
5) After doing that I used Chrome HTML/CSS Analyzer, inspecting the original (and now copied) master page to browse on the zones that needed customization in order to identify the class names/ids/element types that managed the styles to be changed. Once identified I only added to them the properties that required change, EG:
//Webparts Alternate Highlighted Rows
div#ctl00_MSO_ContentDiv table.ms-viewlsts tbody
tr.ms-alternatingstrong{ background-color:#F7FAF4 }
table.ms-listviewtable.ms-basictable tbody
tr.ms-alternatingstrong.ms-itmhover{ background-color:#F7FAF4 }
I mostly did this by myself by trial and error with Chrome Analyzer but I also helped the task using the Chart found here (http://sharepointexperience.com/csschart/csschart.html), tho at some point going thru it turned a bit tricky and I decided to do it by myself as I mentioned. In the process I repeatedly added more styles to the custom file and then overwrote it on the server location to refresh the page/pages to see how it was looking, this till the end of the process.
Thanks for your help, I hope this serves as a guide for anyone that needs it. If you have questions let me know.
You can create a new master page from the scratch or modify the existing one.
Please have a look at this link it may help you to get answers of your questions
http://www.rdacorp.com/wp-content/uploads/ASP-NET-Master-Pages-and-SharePoint.pdf
It's not advised to modify files of SharePoint.
Better to create new master page file, specify all CSS and script you want inside and install this with feature.
What version of SharePoint do you have? SharePoint 2010 Server or Foundation? Cause with server version you can brand your master page in a cool way:
see this link
Microsoft has a good introductory article on how you can/should do this.
http://office.microsoft.com/en-us/sharepoint-designer-help/customize-a-master-page-to-brand-your-site-HA102449505.aspx

Resources