Adding Page Content Edit Buttons

In order to add an edit button to each section on a clients home page, add the code below to each section you want an edit button to appear. You will need to modify a few things for it to work properly

  1. Create a proper URL - You need to change the node number in the URL (highlighted in red in the example code below) to match the node you are trying to edit. For example, if this button is meant to edit the second page content section on the page, you would replace the red number below with a "2".

  2. Create a proper description - You will need to change the text in the <span class="edit-desc"> to match the name title of the page content section you are linking the button to. This text will only show when a logged in user hovers over the edit button.

  3. Add additional styling - The default styling of the edit button will set the button to be positioned absolute in the top-right corner. You may have to declare some inline styling on a per site basis to get buttons to be positioned where it makes the most sense. The stylesheet for this button is included in the perpetua includes folder for all sites.
 <cfif val(request.sessionScope.LoggedIn)>
<a class="pc-edit" style="top: 100px; right: 80px;" href="javascript:openAdminWindow('<cfoutput>#variables.basehref#Admin/index.cfm/fuseaction/pages.dynamic_page_content/pageID/#Attributes.pageid#/nodeid/1/index.html</cfoutput>',900,680);">
<span class="icon-pencil"> <span class="pc-edit-font">Edit</span></span>
<span class="edit-desc"> Header Image Rotator</span>
</a>
</cfif>


Adding Edit Buttons to Partials (Shared Content)

On most websites we will have a footer or bottom partial file that is shared across all pages on the website. In order to create a button that will not throw a page content error we need to create a variable for the page content section we want to link to. We need to define the variables value to be the page content node we want for the home page and also for subpages, and then we place that variable in our buttons URL (highlighted in red below).

<cfif (qry_pageinfo.fldPageID_PK EQ 4677)>
<cfset request.pc_footer_menu = 11>
<cfelse>
<cfset request.pc_footer_menu = 2>
</cfif>

<cfif val(request.sessionScope.LoggedIn)>
<a class="pc-edit" style="top: 100px; right: 80px;" href="javascript:openAdminWindow('<cfoutput>#variables.basehref#Admin/index.cfm/fuseaction/pages.dynamic_page_content/pageID/#Attributes.pageid#/nodeid/#request.pc_footer_menu#/index.html</cfoutput>',900,680);">
<span class="icon-pencil"> <span class="pc-edit-font">Edit</span></span>
<span class="edit-desc"> Header Image Rotator</span>
</a>
</cfif>