有谁知道可以处理 Flash/Flex 内容渐进增强的 php 框架吗?

发布于 2024-07-06 07:19:15 字数 395 浏览 12 评论 0原文

好吧,我在这里使用的术语“渐进式增强”有点松散,但基本上我有一个基于 Flash 的网站,支持深度链接并动态加载内容 - 我想做的是为那些提供替代内容(文本)要么没有Flash,要么有搜索引擎机器人。 因此,对于使用 Flash 的用户,他们将导航到:

http://www.samplesite.com/#specific_page

他们会看到一个 Flash 网站,该网站将导航到“特定页面”。 没有 Flash 的用户会在替代内容部分中看到以文本形式呈现的“special_page”。

基本上,我会使用 php/mysql 创建一个后端来处理所有这些,因为 swf 也使用动态数据。 问题是,是否已经存在这样的东西?

Ok, I'm using the term "Progressive Enhancement" kind of loosely here but basically I have a Flash-based website that supports deep linking and loads content dynamically - what I'd like to do is provide alternate content (text) for those either not having Flash and for search engine bots. So, for a user with flash they would navigate to:

http://www.samplesite.com/#specific_page

and they would see a flash site that would navigate to the "specific_page." Those without flash would see the "specific_page" rendered in text in the alternative content section.

Basically, I would use php/mysql to create a backend to handle all of this since the swf is also using dynamic data. The question is, does something out there that does this already exist?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

夜司空 2024-07-13 07:19:15

您想要实现的目标存在固有的问题。

URL 哈希(或锚点)仅在客户端 - 该令牌不会发送到服务器。 这意味着(据我所知)加载 example.com/#some_page 所需内容的唯一方法是使用 AJAX,它可以读取哈希值,然后从服务器请求特定于页面的数据。

完毕? 不。因为这会杀死搜索引擎机器人。 一个可能的解决方案是让 example.com/some_page 提供相同的内容(事实上,这很容易成为您已经创建的用于返回 AJAX 或 Flash 请求的内容的 REST 服务),并提供 sitemap.xml 索引这些 URI 以帮助搜索引擎。

据我所知,目前还没有专门执行这些任务的框架,尽管看起来确实可以轻松完成这些任务。

There's an inherent problem with what you're trying to achieve.

The URL hash (or anchor) is client-side only - that token is not sent to the server. This means the only way (that I know of) to load the content you need for example.com/#some_page is to use AJAX, which can read the hash and then request the page-specific data from the server.

Done? No. Because this will kill search engine bots. A possible solution is to have example.com/some_page serve the same content (in fact, that could easily be a REST service that you've already made to return the AJAX or Flash-requested content), and provide a sitemap.xml which indexes those URIs to help out the search engines.

I know of no existing framework that does specifically these tasks, although it certainly seems like one could be made w/o too much trouble.

極樂鬼 2024-07-13 07:19:15

好吧,根据 OSFlash (开源 Flash 人士)的说法,CakePHPPHPWCMS 可以满足您的需求,尽管乍一看他们网站的功能列表,它并不完全明显。

让我们知道它们是否有效

Well, according to OSFlash (the open source flash people) both CakePHP and PHPWCMS can do what you need, although from a first glance at their sites' feature list, it is not entirely obvious.

Let us know if they do work!

孤芳又自赏 2024-07-13 07:19:15

如果您将 SWFAddress 与 Flash/Flex 一起使用,那么您可以读取 URL,然后将其拆分为一个数组,然后按照您的意愿进行操作:

SWFAddress.addEventListener ( SWFAddressEvent.CHANGE, onChange );
private function onChange ( e : SWFAddressEvent ) : void 
{
     var ar : Array = SWFAddress.getValue ().split ( '/' );
     trace ( 'Array : ', ar );
}

对于您的非 Flash 内容,如果您使用的是代码点火器,您可以拉取url 并将其也转换为数组。

另一种选择是使用 FAUST。 您可以使用 FAUST 做的是让 PHP 将 HMTL 渲染为有效标记,然后 FAUST 将提取 HTML 并通过 Flash Vars 将其作为 XML 传递给 Flash。 这种方法让搜索引擎非常非常高兴(参见http://www.bartoncreek.com)。

因此,为了回答您的问题,有一些工具可以帮助您实现目标。

if you're using SWFAddress with Flash/Flex then you can read in the URL and then split that into an array and do as you wish:

SWFAddress.addEventListener ( SWFAddressEvent.CHANGE, onChange );
private function onChange ( e : SWFAddressEvent ) : void 
{
     var ar : Array = SWFAddress.getValue ().split ( '/' );
     trace ( 'Array : ', ar );
}

For your non-flash stuff if you're using code igniter you'd be able to pull the url and convert that into an array as well.

Another alternative is to use FAUST. What you can do with FAUST is have PHP render out the HMTL as valid markup then FAUST will pull the HTML and pass that to Flash via Flash Vars as XML. This method makes search engines really really happy ( see http://www.bartoncreek.com ).

So to answer your question there are tools out there that will help you achieve your goals.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文