You are not logged in.
I should have expected this but it's a little more complicated still.
You'll also need to pass the path retrieved in the breadcrumb function to the getAdjustedPath function mentioned above.
I was wondering if you could provide a quick overview of module actions and some example implementations to give an idea of how they can be used. They might be used in the sample code (I haven't seem them yet in my searching), but the documentation is lacking on this feature so I was hoping for at least an orientation before digging through code further -- even how it affects the database would be nice, if it's helpful.
And if I've missed this in the documentation, feel free to just point me there as well. Thanks! ![]()
Created by mistake.
Sure thing.
http://kinyelo.com/bigtree/draw-link.php
http://kinyelo.com/bigtree/draw-link.php
http://kinyelo.com/bigtree/ajax-page-info.php
http://kinyelo.com/bigtree/ajax-get-pages.php
http://kinyelo.com/bigtree/bigtreepagebrowser.js
http://kinyelo.com/bigtree/bigtreepagebrowser.css
Still need some tweaks like validation in the php files, error handling, etc. but it's the basics.
Actually, I chose a slightly different route.
I also wanted a "link" field type that could choose pages from a "page manager" which represented the full tree of pages. So I created a field which has two buttons to the right, similar to the "Upload" field type. One is to choose a resource such as an image or PDF through the BigTreeFileManager, the other is to open my custom BigTreePageBrowser.
It was really straightforward to repurpose your existing code for the page browser. It's quite long because it involves the draw and process scripts as well as the JavaScript and styles, but I'd be happy to share here or elsewhere for consideration to include in future releases (this is coincidentally how I discovered the "getNaturalNavigationByParent" bug). This way, I have a field type that can ensure links to resources and pages, when used individually in data fields, are stored in a maintainable fashion and editors can choose to link to either with just one field.
Very excited about it. Now I just have to figure the best way to include it in the array of items field. :-)
And it's also worth adding that generating the entire page with callouts that reference module tables isn't completely practical. While we can select the column a callout should appear in, maintaining all content through modules, especially when unique and only meant for one page, can get unwieldy when we have a few hundred pages on our sites.
Our templates are a little less fixed in concept in that they are really just layouts -- different proportions of a 16 column grid such as 10/6, 10/3/3, full-width, etc. While callouts allow us to syndicate module content as outlined in the documentation, this doesn't really work for unique content, e.g. the main body content of a page.
On the same token, a fixed set of fields does not really meet our needs for main body content. For example, we could want the main body content to be rich-text, then a photo gallery, then some more rich text followed by maybe a "module" such as maybe an accordion, etc. (again, this is just an example). Not only does this require ordering of content "partials/modules/components", but it requires us to be able to choose which "module/component" type of content to be able to insert into the main body content dynamically and not be limited by a few pre-determined set of fields for a template.
I understand this is a significant technical change in concept from how templates work, so do you have any suggestions on the best approach--if this is really just something that isn't practically feasible within BigTree or even if there is a hacky approach?
In core/admin/js/main.js, the selected file and the file info pane are not properly cleared.
Lines 1408-1409
$("file_browser_info_pane").html("");
$("file_browser_selected_file").val("");
This method in the BigTreeAdmin class references $f instead of $nav_item in the 'while' loop.
That function requires a fourth parameter, 'win' being the window object and then finds the first 'form' element in the document. It seems this is appropriate for TinyMCE (I imagine the window for linking a file in TinyMCE is passed as the fourth parameter) but the field is actually in the second form element on the admin page.
So, in the view for the custom field, I actually created a new method for BigTreeFileManager and am using it successfully. Still going to mess with displaying the field value, etc. Ideally, my goal will be to create a field that the editor can choose to link to a file or a page and then browse the files or the pages (which is the next big hurdle).
Hi, Tim:
I noticed something else. In our multi-site setup, these sites will likely share resources as the design is unified but
the content is for the most part separate. One trouble was the router checking for a cached file.
Because it replaces URLs in the styles and JavaScript, it would serve the last cached file to domain A but it would contain URLs from the domain for which it was cached, say domain B. So I simply appended the $_SERVER['HTTP_HOST'] to the cached file name, $cfile, in the router processing for styles and JavaScript.
Thanks again,
Michael
Hi, Tim:
Thanks for your guidance with this (and all the discussions). I took a slightly different approach based on our requirements.
First, we are using Single Sign On which enforces some basic authorization which is all we require and no pending changes will likely be sensitive in nature so simply an obscured URL with the "_preview" path will be enough. So what I did was edit one line in the custom router, around line 230. Instead of checking for the path and an administrator session, I just check for the "_preview" path and remove the admin check.
// See if we're previewing changes.
$bigtree["preview"] = false;
// if ($bigtree["path"][0] == "_preview" && $_SESSION["bigtree_admin"]["id"]) {
// EDIT: remove check for admin
if ($bigtree["path"][0] == "_preview") {This is especially nice because it also removes the administrator bar on the page. I have yet to see any complications, but please let me know if I am missing something.
Thanks,
Michael
I've been working to integrate the BigTree CMS admin console with Single Sign On and I thought I'd share my solution. It was pretty simple but I hope it's helpful.
Create a custom admin router at custom/admin/router.php editing the following line:
// If we're not logged in and we're not trying to login, redirect to the login page.
if (!isset($admin->ID) && $bigtree["path"][1] != "login") {
$_SESSION["bigtree_login_redirect"] = DOMAIN.$_SERVER["REQUEST_URI"];
//If not logged in, try to log the user in. This will just return false if failing and send the user to the login page
$admin->login();
BigTree::redirect(ADMIN_ROOT."login/");
}Then, in a custom BigTreeAdmin class, override the login method and edit the lines below. This involves replacing the email with the $_SERVER['REMOTE_USER'] variable and, if not included, appending the domain statically or from another environment variable. Then instead of checking the password (commented out), just check for a result when querying for the user.
$f = sqlfetch(sqlquery("SELECT * FROM bigtree_users WHERE email = '".sqlescape($_SERVER['REMOTE_USER'])."@[url]domain.com[/url]'"));
// $phpass = new PasswordHash($bigtree["config"]["password_depth"], TRUE);
// $ok = $phpass->CheckPassword($password,$f["password"]);
if ($f) {-Michael
Hi,
What is the best way to add a user role such as 'Previewer' so changes can be circulated to non-editors before being published? An alternative would be to remove access control to preview URLs but the former solution is preferred.
Thanks,
Michael
One other method that seems to complete the changes is an update to getInternalPageLink.
-Michael
Hi,
How can I create a field type that uses the file browser triggered by the hyperlink button in the RTE? It would be nice to link to documents and other files that are managed centrally through the file browser as opposed to uploading them each time they are needed in a module outside of an RTE.
I'm assuming I can get started from the php ajax files for the file browser and the php files for the upload field but hopefully you can provide some guidance to help me navigate a solution quicker.
Thanks,
Michael
Hi, Tim:
I thought I'd share my experience with the community. Indeed, after trying some cleverness using Rewrites and Aliases, I turned to the code and it lead me to do exactly what you outlined.
I'm using three subdomains: one is used for administrators to publish content and two are separate intranet sites. In the custom router, array_merge was not working because the '0' index is blank at times and merging the arrays leaves, for example, the '0' index filled but pushes the blank to the '1' index and causes errors. Instead, if the '0' index was not blank, I performed "array_unshift" (but "array_merge" would have worked), otherwise I just set the '0' index. I expect this wouldn't be a problem if I never accessed the parent page of the trunks serving these intranet branches, but for completeness, I've mentioned this.
I also had to edit the config.php. The method I used is to check the host of the request and depending on the subdomain, setting the root URLs in the config array.
Finally, I overrode the getNavByParent and getLink methods using a custom method, getAdjustedPath.
My trials seem to be working well. Can you see anything I am missing, including methods from the BigTreeCMS class? Would editing the config.php as I did cause any errors I have not yet encountered?
I'll update this thread with my progress if I make further customizations. Thanks for your previous notes!
-Michael
Hi, Tim:
I echo Nicolas's desire to use BigTreeCMS with multiple sites. I was wondering if you had any more specific advice on how to implement this using subdomains? Our organization is keen to use BigTreeCMS and we likely will, but it would be ideal if it supported multiple sites on different subdomains. Our requirements are pretty flexible but we'd like to be able to share some resources (styles, templates, etc.) while keeping other resources, like images, accessible only behind the domains for which they're intended. By flexible, among other techniques, I mean that we can use rewrite or links to reference resources to enforce the separation for example.
My hopeful self is telling me that there's some clever solution but without full knowledge of the system, I am only grasping in darkness at times for how best to do this.
Also, do you know when version 4 might be out of RC and if the final release will include this support?
Thanks,
Michael