Plone 4.1.5
plone.app.iterate 2.1.5
To see the behavior:
Create a folder ('foo')
Create a page ('bar') within folder 'foo'
Checkout a working copy ('copy_of_bar') of page 'bar'
Checkout a working copy ('copy_of_foo') of folder 'foo'
Checkin 'copy_of_foo'
Now, 'bar' is still locked but no longer shows the info viewlet linking to the working copy. 'copy_of_bar' appears to have become a normal (non-wc) page. Interestingly, this break doesn't occur if you checkout the page after checking out the folder (ie. checkout 'bar' within 'copy_of_foo').
Looks like it's breaking on the folder checkout. If you look at the pages in 'copy_of_foo', 'copy_of_bar' is already acting like a non-wc page.
Related
I'm in the process of building a new website and I am making use of the Kentico new website wizard.
On step 5, you get to select a master page. Currently I see 2 default options.
How am I able to add my own custom master page that I created and saved in the CMSTemplates folder?
Any help would be great.
Thanks
After you created the template in CMSTemplates - I assume it is ASPX template, have you registered it in Kentico as master page template? If not, please see the documentation on creating ASPX templates.
It really does not matter. You can go with default blank master page or any other option and later on you can change it. After creating a site you will end with one root element in the tree and the master template assigned to it (the one you chose in the wizard). Now you can change your master template: go to page templates and create a new one, then go back to the root page and go to root page properties/template and assign the one you created.
This root master template is not some "read only? frozen forever" thing. You can change it to different one at any point at time.
P.S. If you want your template appear in the site wizard - just create it in advance, mark it as master template and it will appear.
There are two things required to do.
Put the newly created template in the "Templates" folder then run an insert statement in SQL to "register" the template so that it will show up when in Kentico when you want to create a new site from the internal web templates.
This is how I did it.
In order for the user to click to add a new website so that our new custom website template is displayed in the list of websites,we need to add this information to the CMS_WebTemplate database table so that Kentico can map or “register” the physical path to the custom website template.
The script is as follows:
INSERT INTO CMS_WebTemplate
SELECT 'New Site For Testing',
'~\App_Data\Templates\BlankNewSite',
'{$webtemplate.blanksite.description$}',
NEWID(),
GETDATE(),
'BlankNewSite',
10,--order of the website template so you need to look for the last digit and increment by 1
'F;B;N;X;V',
'a928c1d2-1bcd-459c-abcb-9f5a08978017', --default web thumbnail id for the blank site
The Blank New Site for testing provides a template for creating new websites from scratch, based on the portal engine.'
Now, the user will be able to create a new website using the new template that was placed in the C:\inetpub\wwwroot\Kentico10\CMS\App_Data\Templates directory which lives inside of the Kentico CMS web application
Steps:
1. Clone and rename existing website templates from C:\inetpub\wwwroot\Kentico10\CMS\App_Data\Templates
2. Run script in the database to map the website template and it’s physical path
3. Run wizard to create new website
Outline
I have a custom type (Dexterity) called "Gallery Profile", for this type I went into the ZMI (portal_skins/custom), created a new "Page Template" and wrote a custom template for my gallery. The gallery contains a bunch of lower down images and one main image of the owner of the gallery, like a News Item view but a gallery tacked on the bottom.
The customer wants this main image to be published to Facebook when someone hits 'Share' and some more specific info in the title when published.
Work carried out
Configured a Rapido script to write the 'og:image' meta data etc HTML that is required to get this to work (the default Plone stuff only publishes the sites logo unless you're viewing one Image type).
If I go to test the HTML coming out of Rapido via direct web address it works swimmingly. (site.com/##rapido/og_share/block/og_share) - I'm on the slightly older version of Rapido hence the non-plural version of block.
The problem
If you go to my gallery page where we have applied the template, then check the HTML, all of the OG meta data is pointing to the template instead of the current page its on.
This effects queries too (if for example you're using a script to find out what images are within a folder) - it searches /my_template instead of site.com/a_folder/my_template_is_on
In the Rapido Python file I've tried things like:
context.content.absolute_url()
context.content.absolute_url_path()
context.request['URL']
context.request['VIRTUAL_URL']
context.request['ACTUAL_URL']
... and probably more as I've been at this a while.
If you're not on the custom template, it works.
To Reproduce
Create a custom template
Assign it as the default view of a folder or any type.
In your template put <div tal:replace="structure python:context.REQUEST"></div> (just to see the difference)
In your Rapido try using context.app.log() and any of the above
Refresh your templated folder while checking the logs and the output from the context.REQUEST stuff.
You will see the differences and how Rapido is having a hard time getting the URL of the page you are on even though its there.
I've always had this problem with Rapido I just tend to work around it but in this particular situation I am stumped.
So in summary
Am I being an idiot and missing something obvious?
Is this possible?
Thank you for your time.
We're creating a database of files on a new Plone 4.3.2 website, using eea.facetednav as the main interface. In order to have multiple searchable "tags" plus additional information like publish year, article type, etc etc, we've created custom Dexterity content types for these "files". One of the fields on the Dexterity content type is to upload the actual file.
Everything was going swimmingly UNTIL I realized...
One of the basic functionalities of linking to "files" is now broken. Whereas we would expect creating an internal link to a file will prompt opening the file or downloading it when clicked, now it just takes you to the "view" for the new Dexterity content type, where there's a link to the actual file.
This is pretty cumbersome. Has anyone done this before, or found a way to have it automatically link to download the file? If we need to disable/scrap the Dexterity content type view in favor of the direct link, that's probably fine, but bonus points if you can think of a way to make this work both ways (i.e. have a linking method that takes it to the file and a linking method that takes it to the view).
This is the page I mean by "view", in case it's unclear:
... Off the top of my head, I can think of a weird Diazo solution of making a custom template that parses this view and automatically redirects to the file link, but that seems wrong/weird. Other thoughts?
I'll go for the bonus points, though I haven't fully tested this...
First, you have to designate your file field as the content type's "primary" field. Unfortunately this option doesn't show up in the UI so you have to edit the XML version of the schema (there's a button for this in recent versions of the dexterity control panel). Add xmlns:marshal="http://namespaces.plone.org/supermodel/marshal" as a namespace at the top, and add marshal:primary="true" to the field tag in question.
Then, find your type in portal_types and change the "Default view method" to ##download. (It usually starts out as view for Dexterity content types.) This should make the item's URL download the file rather than showing the normal view. It knows which field to use because you designated it as primary.
You can still access the normal view by adding /view to the end of the item's URL. If you want Plone to do this when linking to the type from navigation and folder contents (just like it does for built-in images and files), go to portal_properties/site_properties and add the type's id to the typesUseViewActionInListings list.
If I had to solve this problem, I'd take the "link" content type view in plone.app.contenttypes as a model.
When someone asks to see a link content type object, the view looks to see if the requestor has the Modify portal content permission on the link object. If they do, they see the conventional view, giving them the opportunity to edit. If they don't, the view returns a redirect to the target URL.
Your code would be simpler. After checking the permission, you'd only need to append ##download/field_name to get the redirect URL.
So I was going through the settings in the Views Module and hit a checkbox and clicked save. This unfortunately transformed the entire Views UI into my custom theme's homepage. And trying to go into settings does not allow me to see anything except my custom homepage. I've tried uninstalling the module and deleting EVERYTHING but nothing seems to work. How can I manually undo check whatever box I had checked.
it needs a little bit of debugging.
go into views source code, look for .module files and search for
hook_menu() implementation
find there an URL where you have checked that checkbox
go into page callback function
check for submit callback function and go to that function
look for update queries or variables settings, anything that have a machine name of your checkbox, look for the mysql table and field
go into database and update that field to your needs
you can also use a fresh drupal install to perform this, it will be easier to just copy the value from one database field into another
I'm looking to find a WordPress plugin that ads an upload widget to my post editor to allow me to associate images with posts.
The end result is that I can add a bit of code to my theme's single.php file that allows me to load all of the images that reside in the folder matching the post id.
If no such plugin exists, I'm looking for some help on creating one.
Here's the way it would work..
Any images uploaded to a specific post, will go into a folder named after the post id. For example, if you are editing the post with id=420, the uploaded files will go into a folder named "420". There would also need to be some way to add or remove images from the folder without leaving the post editor (though FTP could be used for this as well).
To show post specific images, the single.php file checks to see if there is a folder under wp-content/uploads matching the post id. If it finds a match, it simply loads all the images it finds in the folder.
You can already attach images to a post without including them in the main content. You can do all of this in the main Edit Post window (the first icon next to "Upload/Insert" above the text editor. They are added with the post id as parent_id parameter, so the get_children function will give you all attached files.
This will store the images in the standard /wp-content/uploads/ folder, grouped by year and month (if you checked that option in the administration page). If you want to change the upload directory, you can use the upload_dir filter (slightly outdated parameter list) and return a different upload directory, for example with the post ID. The upload_dir filter is called from wp_upload_dir(), which is called by wp_handle_upload(), which is called by media_handle_upload(), which is called from the media-upload.php file.
If you want to extend this idea and check the upload dir for new files (uploaded via FTP for example), and attach these to the post, I suggest you look into the attachment functions.