Change the name given to content of a block by Concrete5?
Permalink
Within the page types of my Concrete5 theme there is this...
If a user or I want to create a new page that has the sidebar on the the left and uses different Sidebar content on the left...well, having content named Sidebar won't do.
I will want to name the left sidebar content "Left Sidebar" and rename the current right Sidebar content to "Right Sidebar" so that I can keep things straight :).
Now I know that in this case I could just leave the right sidebar as having the name "Sidebar" and just create a new content within the left sidebar page type and name it "Left Sidebar" but I am a stickler for making things clear and unconfusing. Especially if I return to this code years down the road and start wondering why in the world I named the one sidebar content in a different way than the other one.
Which all leads me back to my question.
Does someone know the specific database table name that has the names of the content within the Concrete5 blocks being used on a site?
And what field within that table holds such names?
Furthermore can I just go in and "manually" change said name values in the table without affecting anything else in Concrete5 in some other table that is linked to the existing content name?
What is the best way to change the name used by Concrete5 to refer to some content in a block (in the above case "Sidebar" and "Left Sidebar" and "Right Sidebar" being examples of these types of block content names)?
Any insight or tips anyone might care to give me would be appreciated.
Thanks.
Carlos
<div id="column-right"> <?php $a = new Area('Sidebar'); $a->display($c); ?> </div><!--column-right-->
If a user or I want to create a new page that has the sidebar on the the left and uses different Sidebar content on the left...well, having content named Sidebar won't do.
I will want to name the left sidebar content "Left Sidebar" and rename the current right Sidebar content to "Right Sidebar" so that I can keep things straight :).
Now I know that in this case I could just leave the right sidebar as having the name "Sidebar" and just create a new content within the left sidebar page type and name it "Left Sidebar" but I am a stickler for making things clear and unconfusing. Especially if I return to this code years down the road and start wondering why in the world I named the one sidebar content in a different way than the other one.
Which all leads me back to my question.
Does someone know the specific database table name that has the names of the content within the Concrete5 blocks being used on a site?
And what field within that table holds such names?
Furthermore can I just go in and "manually" change said name values in the table without affecting anything else in Concrete5 in some other table that is linked to the existing content name?
What is the best way to change the name used by Concrete5 to refer to some content in a block (in the above case "Sidebar" and "Left Sidebar" and "Right Sidebar" being examples of these types of block content names)?
Any insight or tips anyone might care to give me would be appreciated.
Thanks.
Carlos
Well...I found the table with the Area handle names in them.
Area.
If I change the handle name in the code listed in my first post here...to a new name not yet in existence and add a content block to that area on the page, C5, adds a record to the Area table and stores the new handle to any new content I have created within that named area.
The previous block content no longer appears on the page however.
It's still there...just not known by the new handle name and thus not visible on the page.
But if I change the old handle name in the Area table to some gibberish new name and then change the code to use that new gibberish name...the old content still doesn't appear.
Unless I change the handle in the code back to what it was.
I don't quite understand why that is.
Hmm...guess I will dig around some more.
Back to hacking the C5 core :).
I know this may seem utterly pointless but to me...it's practical in that I do want to change the handle names and should be able to do it. Besides...learning where things are stored by C5 inside the database will come in handy.
Carlos
Area.
If I change the handle name in the code listed in my first post here...to a new name not yet in existence and add a content block to that area on the page, C5, adds a record to the Area table and stores the new handle to any new content I have created within that named area.
The previous block content no longer appears on the page however.
It's still there...just not known by the new handle name and thus not visible on the page.
But if I change the old handle name in the Area table to some gibberish new name and then change the code to use that new gibberish name...the old content still doesn't appear.
Unless I change the handle in the code back to what it was.
I don't quite understand why that is.
Hmm...guess I will dig around some more.
Back to hacking the C5 core :).
I know this may seem utterly pointless but to me...it's practical in that I do want to change the handle names and should be able to do it. Besides...learning where things are stored by C5 inside the database will come in handy.
Carlos
Hmmm...it appears that the arID field value inside the Area table is the value used to refer to an area. Not the area handle (i.e. the value in the arHandle field).
So changing the arHandle field value inside the Area table doesn't cut it with respect to changing the name of the handle for an Areas content and using a new name in place of the old one.
The problem is that I previously gave a handle of "Left Sidebar" to some content I created for a page with a left sidebar. Now that the client wants the sidebar on the right...I am faced with a situation in the code where I have a CSS ID of "right-sidebar" with the area handle in the code underneath it as "Left Sidebar" which is very confusing.
I need to figure out a way to pull in the previous Left Sidebar content into an area more appropriately named as "Right Sidebar" which involves changing the name of the area handle used.
Carlos
So changing the arHandle field value inside the Area table doesn't cut it with respect to changing the name of the handle for an Areas content and using a new name in place of the old one.
The problem is that I previously gave a handle of "Left Sidebar" to some content I created for a page with a left sidebar. Now that the client wants the sidebar on the right...I am faced with a situation in the code where I have a CSS ID of "right-sidebar" with the area handle in the code underneath it as "Left Sidebar" which is very confusing.
I need to figure out a way to pull in the previous Left Sidebar content into an area more appropriately named as "Right Sidebar" which involves changing the name of the area handle used.
Carlos
Okay...for what it's worth I figured out how to do this.
It's a hassle and a half but I don't have time to keep hacking away at the core to understand it's rather confusing mish mash to figure out which table does what in attempts to rename an Area to a different handle name.
To rename the handle that C5 uses to refer to a block Area on a page...
1. Edit the page in question
2. Copy the Area to the Scrapbook
3. Go into the page type file and change the name of the Area to the new name you want to use
4. Refresh the page (which causes the page to now be using the new Area so named in step 3).
5. Paste the old blocks and content from the Scrapbook.
And voila! You have renamed the old Area handle to the new one.
Hope that helps somebody.
Carlos
It's a hassle and a half but I don't have time to keep hacking away at the core to understand it's rather confusing mish mash to figure out which table does what in attempts to rename an Area to a different handle name.
To rename the handle that C5 uses to refer to a block Area on a page...
1. Edit the page in question
2. Copy the Area to the Scrapbook
3. Go into the page type file and change the name of the Area to the new name you want to use
4. Refresh the page (which causes the page to now be using the new Area so named in step 3).
5. Paste the old blocks and content from the Scrapbook.
And voila! You have renamed the old Area handle to the new one.
Hope that helps somebody.
Carlos
So I guess a more appropriate question might rather have been...
How do I change the handle name (i.e. Sidebar, Left Sidebar, Content, etc..) associated with some content in some blocks in a given area of a page?
So for example if I no longer want all the content inside blocks in the right sidebar to be associated with the handle "Right Sidebar" anymore but rather with the handle "Left Sidebar" how do I change the association of those blocks with than handle "Right Sidebar"?
It's not a matter of just changing the handle name used since changing the handle name in the code will prevent any of the existing blocks associated with that handle from having their content displayed.
Carlos