#26 Re: Developer Help » Renaming tables » July 12, 2018 3:21pm

Foreign keys, changed parent ids, etc was precisely what I was in the dark about, but it looks like those are not a concern. (The tree structure of pages is also changing.)

I will go for the easy way—a Sequel Pro import is fine by me. But it's also good to know that table renames don't have any fundamental problems.

Thanks Tim!
Tushar

#27 Re: Developer Help » Renaming tables » July 12, 2018 12:11pm

Okay, we have now frozen content on live, copied live to dev, and begun publishing on dev.

Could you clarify the "migrate the bigtree_pages table from stage -> live" part? What is a safe way to do that?

I was wondering if importing the entire stage bigtree_pages to the live db (under a different name), then renaming it, would be okay. But is there a better way?

Thanks for all your help,
Tushar

#28 Developer Help » Renaming tables » July 12, 2018 10:30am

tsamant
Replies: 4

Hello,

Probably unusual, but: I am thinking of swapping bigtree_pages with another "shadow" table.

The context is this. There are extensive editorial changes over many pages that all have to publish at the same time, "atomically" so to say. They have to be ready and viewable beforehand (i.e. published on a staging server). There are a few other constraints as well.

This leads me to think that the simplest way to publish all the staged edits would be to populate a staged_bigtree_pages table in production, and rename it to bigtree_pages at the right time. (The schema will be the same.)

I am not sure this will work. Are there any caching gotchas, would I have to restart the server, etc. How realistic is this plan?

Best,
Tushar

#29 Re: Developer Help » Alternative Views of Subpages » July 11, 2018 6:02pm

That's a great idea! I will try it as soon as I can. Thanks! Tushar

#30 Developer Help » Alternative Views of Subpages » July 10, 2018 4:35pm

tsamant
Replies: 2

Is there a way for admin to selectively list subpages of a page by their template type? The subpages view seems to have three sections: visible, hidden and archived. It would be convenient for us to see a section with only subpages of the type 'link-list'. Or any other way of subsetting them.

Building views of custom modules is pretty flexible, but building alternate views of  bigtree_pages is not something I have encountered. Any ideas?

Best,
Tushar

#31 Re: Developer Help » Class not found in templates/basic/home.php » June 18, 2018 12:42pm

Tim, that did the trick, thanks! Learned something new today.

Tushar

#32 Developer Help » Class not found in templates/basic/home.php » June 18, 2018 11:08am

tsamant
Replies: 2

Summary: I am trying to set up a new module on a local server (apache on mac) and the code dies due to not finding class 'CAFHomeHero' (just an example).

I think I did everything right in admin: a module, a view and form, etc. The only glitch was that custom/inc/modules/home-hero.php was already created, so admin failed to create it. There is not much in that file:

<?
	class CAFHomeHero extends BigTreeModule {
		var $Table = "caf_home_hero";
	}
?>

The table exists.

After all this, refreshing a page still dies with a message like:

Class 'CAFHomeHero' not found in .../templates/basic/home.php

What am I missing?

Thanks,
Tushar

#34 Developer Help » How to implement a new (possibly) admin widget » April 9, 2018 10:22am

tsamant
Replies: 2

Hi,

A certain template I am defining needs a variable-length list of web links. A link is (for now) a URL and anchor text, both text fields.

I am trying to put together a friendly UI for admins but I am confused.

I see similar widgets throughout admin (callouts, categories, etc), and it seems that a "matrix" field might do the trick. Is this right? If not, what is the minimum code that would have to be written?

Thank you,
Tushar

#35 Re: Developer Help » Batch-upload into file browser » September 5, 2017 2:43pm

Thanks for the clarification, Tim. This is clearly going to be a somewhat long-term project for us; it's good to know what it involves.

Best,
Tushar

#36 Developer Help » Batch-upload into file browser » August 30, 2017 3:21pm

tsamant
Replies: 2

I am trying to see how feasible/useful it is to do a type of batch upload of images, so they are available from the file-browser admin.

We use amazon S3.

My first guess is that calling BigTreeStorage::store for every image file in question would do the trick. But is this right? Will the image end up in the right folder, and fully usable, and with thumbnails etc?

Best,
Tushar

#37 Re: Developer Help » Granular edit permissions » August 4, 2017 4:12pm

Tim, thanks for the idea. Interestingly, Opengraph tags are the big need, not SEO fields. Best, Tushar

#38 Re: Developer Help » Granular edit permissions » August 2, 2017 2:47pm

I more or less expected that, and it will be hard to get permission to spend time on it.

Maybe a module with a table to keep SEO data, which overrides the page's own data, is a practical idea?

We will probably be OK with module-level permissions if it is not a very powerful module.

#39 Developer Help » Granular edit permissions » August 1, 2017 11:19am

tsamant
Replies: 4

I am trying to put a certain type of permission structure on BigTree pages but can't figure out the best way.

The aim is to allow editing only a couple of SEO fields, to specific users. The page content, etc should not be editable. The smaller the form they see, the better.

What is the cleanest way to get this effect?

Best,
Tushar

#40 Re: Developer Help » Changing header markup from inside the page » June 8, 2017 6:04pm

Apologies for the late reply. You are right. There are some indirections, and variables being set from other variables, that were confusing me. Thanks! Tushar

#41 Developer Help » Changing header markup from inside the page » June 1, 2017 3:06pm

tsamant
Replies: 2

My basic problem: I need to change a bit of markup high on the page--it's in templates/layouts/_header.php. It is to be dependent on the specific template being used for any given page.

I thought that simply setting a variable in the innermost template and reading it in the outermost would do the trick. But I don't think I have understood how Bigtree composes a page exactly.

Here is the concrete problem. We have this in templates/layouts/_header.php:

<meta property="og:image" content="<?=$page_image?>">

I want to set (or get the effect of setting) $page_image from inside templates/routed/calendar, and other such templates.

What's a good way to go about this?

Thanks,
Tushar

#42 Re: Developer Help » Clearing the view cache » April 13, 2017 12:57pm

OK, I think I will not clear module view caches after all.

It's still good to know--for instance I could clear it on a staging server etc.

Thanks!
Tushar

#43 Developer Help » Clearing the view cache » April 12, 2017 2:34pm

tsamant
Replies: 2

I am about to run

delete from `bigtree_module_view_cache`;

directly on the production server.

Am I right in thinking that this will definitely, absolutely have no effect whatsoever on the user-facing site?

Thanks,
Tushar

(this one table is now 2/3rds of the db)

#45 Re: Developer Help » Extending FormBuilder » October 20, 2016 2:45pm

Thanks!

By secret key (for the templates/ajax way), do you mean an ssh key? Or logic in the script to check a key?

#46 Developer Help » Extending FormBuilder » October 20, 2016 10:53am

tsamant
Replies: 4

I am thinking of a side project involving FormBuilder, but not sure how to organize it.

The aim is to produce a json export of form submissions, given a date range. In the ideal scenario, the form in question would be located via the page it is included in.

Much of this code is ready in command-line form. But what is the right place to install it? Would I have to patch FormBuilder, or should I make a custom class?

Related questions:

What would be a good URL for this sort of endpoint? E.g. for http://example.com/admin/pages/edit/1/ it would be nice to have a predictable json URL.

Is there a way to log in to admin from the command line? It would be great to script this sort of thing with e.g. curl.

Best,
Tushar

#48 Developer Help » Request count in bigtree_404s » October 20, 2015 11:14am

tsamant
Replies: 2

It seems that handle404() increments the requests column every time a 301 redirect is issued.

Wanted to confirm: does this number ever get reset or changed? If a manual action is the only way to change it, we are going to use it in a report.

Thanks! Tushar

#49 Re: Developer Help » A file browser problem » July 7, 2015 10:35am

Yes, there is indeed a bug; we have seen that upload-with-replace to S3 does not replace, but creates a file with a fresh numerical suffix.

No complaints this one time! But we do have a growing number of unnecessary files.

#50 Developer Help » A file browser problem » July 6, 2015 5:00pm

tsamant
Replies: 3

We have a file browser in admin that is backed by S3.

An admin just managed to "delete" a folder. As far as I can see, this means that some rows in bigtree_resource_folders and bigtree_resources have disappeared.

Thanks to S3, the site continues to serve files that were in the "deleted" folder. But they are now unavailable from the file browser.

I can restore the rows that were dropped from the two tables. But is that the right thing to do?

Best,
Tushar

Board footer

Powered by FluxBB

The Discussion Forum is not available on displays of this size.